|
I'm looking for a good open source Gantt chart library for Java Swing. I tried JFreeChart but it is not able to draw subtask. I tried with SwiftGantt too. It is able to draw subtask, but it is a little unstable and the look and feel is not professional :(.
Can you recomends others?
Thanks in advance!
|
|
|
|
|
Sorry if this is an offtopic in this group.
I want to buy a laptop for Java development. Of course the question would be simple if I were doing just plain Java development. But I want to try new technologies often used with Java - Kubernetes, Docker etc. That's why I'm asking it here.
These technologies (K8s, Docker) use virtualization. I know that you need to set something in BIOS/UEFI to run Docker. Some years ago I had to buy a new CPU to run 64-bit virtual machines, because my previous CPU was not supporting 64-bit guest virtual machines. The feature in question was called VT-x.
Of course the sure thing would be to buy a Mac, but I want a 500-600 EUR laptop.
So the question is:
1) Do I need to search for some show-stopper CPU features when choosing a computer?
2) Anything that does not work on AMD chips?
3) Is 8GB RAM sufficient for small/medium sized personal projects?
4) Any other pitfalls?
5) Is Windows 10 Home somehow unusable for professional software development?
|
|
|
|
|
8GB would be fine for dev work, but testing may be pushing it. You're very likely going to be limited to running one virtual machine along side your other dev stuff.
Get the fastest processor you can for the money and make sure you get a machine running on an SSD, preferably 1TB.
The only other thing I'm going to tell you is stay away from Windows Home. It will not support virtualization.
|
|
|
|
|
I will answer your questions on by one.
1. If you go for a medium-range Intel i5 or i7 CPU, you are getting a quite versatile CPU which will satisfy all your needs. If your workload includes hardcore video editing and image processing, then you will be better off with the AMD. Otherwise, nothing beats Intel.
2. For CPU chips, in terms of processing, AMD lags behind Intel in every aspect except for video editing. While AMD GPUs are better for graphic creation, you need NVIDIA GPUs to run CUDA.
3. Judging by the workloads that even web browsers are putting on RAMs nowadays, you should go for 16 GB RAM minimum.
4. While the MacBook is the first choice for many, you will enjoy the playfulness of a Windows laptop.
5. Installing frameworks can be tedious on Windows but nothing worth complaining once you get used to it. One huge benefit of a Windows machine is that you can create a Dual boot with Linux or install Linux in a Virtual Machine software. Then you can use both and choose your favorite.
|
|
|
|
|
|
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.ResultSet;
import java.sql.Statement;
import java.sql.DriverManager;
import javax.swing.JOptionPane;
public class Workers extends javax.swing.JFrame {
Connection con;
Statement stmt;
ResultSet rs;
public Workers() {
initComponents();
DoConnect();
}
public void DoConnect(){
try{
String host="jdbc:derby://localhost:1527/Employee";
String uname= "Star";
String uPass ="ST@r6738";
Connection con=DriverManager.getConnection(host, uname, uPass);
Statement stmt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_UPDATABLE);
String SQL="SELECT * FROM WORKER";
ResultSet rs=stmt.executeQuery(SQL);
rs.next();
int id_col =rs.getInt(1);
String ID_=Integer.toString(id_col);
String first_name=rs.getString("FIRST_NAME");
String last_name=rs.getString("LAST_NAME");
String job_title=rs.getString(4);
textID.setText(ID_);
textFirstname.setText(first_name);
textLastName.setText(last_name);
textJobTitle.setText(job_title);
}
catch(SQLException err){
System.out.println(err.getMessage());
}
}
@SuppressWarnings("unchecked")
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
textFirstname = new javax.swing.JTextField();
textID = new javax.swing.JTextField();
textLastName = new javax.swing.JTextField();
textJobTitle = new javax.swing.JTextField();
jLabel1 = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
btnFirst = new javax.swing.JButton();
btnPrevious = new javax.swing.JButton();
btnNext = new javax.swing.JButton();
btnLast = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
textID.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
textIDActionPerformed(evt);
}
});
jLabel1.setText("JOB Title");
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(textID, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 26, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(textFirstname, javax.swing.GroupLayout.PREFERRED_SIZE, 146, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(textLastName, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(3, 3, 3))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addComponent(textJobTitle, javax.swing.GroupLayout.PREFERRED_SIZE, 302, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(textID, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(textFirstname, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(textLastName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(textJobTitle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel1))
.addGap(41, 41, 41))
);
btnFirst.setText("First");
btnPrevious.setText("Previous");
btnPrevious.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnPreviousActionPerformed(evt);
}
});
btnNext.setText("Next");
btnNext.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnNextActionPerformed(evt);
}
});
btnLast.setText("Last");
btnLast.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnLastActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(btnFirst)
.addGap(18, 18, 18)
.addComponent(btnPrevious)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnNext)
.addGap(18, 18, 18)
.addComponent(btnLast)
.addContainerGap())
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnFirst)
.addComponent(btnPrevious)
.addComponent(btnNext)
.addComponent(btnLast))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(21, 21, 21))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(602, Short.MAX_VALUE))
);
pack();
}
private void textIDActionPerformed(java.awt.event.ActionEvent evt) {
}
private void btnNextActionPerformed(java.awt.event.ActionEvent evt) {
try{
if (rs.next()){
int id_col =rs.getInt("ID");
String id=Integer.toString(id_col);
String first_name=rs.getString("FIRST_NAME");
String last_name=rs.getString("LAST_NAME");
String job_title=rs.getString(4);
textID.setText(id);
textFirstname.setText(first_name);
textLastName.setText(last_name);
textJobTitle.setText(job_title);
}
else{
rs.previous();
JOptionPane.showMessageDialog(Workers.this, "End of file");
}
}
catch(SQLException err){
JOptionPane.showMessageDialog(this, err.getMessage());
err.printStackTrace();
}
}
private void btnPreviousActionPerformed(java.awt.event.ActionEvent evt) {
}
private void btnLastActionPerformed(java.awt.event.ActionEvent evt) {
}
public static void main(String args[]) {
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Workers.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Workers.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Workers.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Workers.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Workers().setVisible(true);
}
});
}
private javax.swing.JButton btnFirst;
private javax.swing.JButton btnLast;
private javax.swing.JButton btnNext;
private javax.swing.JButton btnPrevious;
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JTextField textFirstname;
private javax.swing.JTextField textID;
private javax.swing.JTextField textJobTitle;
private javax.swing.JTextField textLastName;
}
|
|
|
|
|
You need to use your debugger to step through the code in that method to find out which reference is null. It is not something that anyone here can do for you.
|
|
|
|
|
Message Closed
modified 25-May-20 13:01pm.
|
|
|
|
|
|
But then he wouldn't be able to push his spam link to his article writing service.
NB: The person you're replying to isn't the OP.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
|
We have been given a project for my ComSci class and I've done what i think is half, but got feedback today and it was devastating. I dont know what to do. The final hand in is on the 1st of June. Is there anyone willing to maybe help me write the code? The most complex coding knowledge needed is 2D arrays. I would really appreciate it
|
|
|
|
|
Sorry, this site does not provide code to order. For a start it does not help you to hand in work written by someone else. If you cannot understand your assignment then you need to go over your study and course notes a few more times. There is also lots of useful information and sample code at The Java™ Tutorials[^]
|
|
|
|
|
Hi, first time posting so hopefully doing it correctly. I have used a form builder to build my forms but have run into a couple of issues with functionality. In the code/calculation below I need to be able to return the answer 0 if the answer is less than 0. I've searched loads to no avail so any help would be much appreciated. T.I.A.
$('form#Commission #Commission_On').formCalc(" Nett_Earnings -Actual_Takings >0==0",{ currency_format:true, mirror:'sfm_Commission_On_parsed'});
modified 17-May-20 10:15am.
|
|
|
|
|
What language is that, it does not look much like Java? However assuming it is supposed to convert that string into an actual sum it does not look valid. In the expression Nett_Earnings -Actual_Takings >0==0 , what is >0==0 supposed to mean?
|
|
|
|
|
Thanks for answering, I just assumed it was Java as all the scripts are. >0==0 is just one of the ways I was trying to make it work from their info before they told me the form couldn't do the calculation.
|
|
|
|
|
What is this code and where did you get it from? As I said it does not look anything like Java.
|
|
|
|
|
Thanks for answering. The programme is called simfatic form maker.
This was their reply to my query
"Simfatic Forms calculation field can't handle multiple levels of variables. In this case, the user enters a variable that intern is a variable in the next step.
This form has to be hand coded with the help of a developer"
Here is the actual form I am trying to make work https://www.salonlogic.co.uk/forms/Commission/Commission.php[^]
|
|
|
|
|
Sorry, but this has nothing to do with Java programming. You need to talk to the people who created this package for information.
|
|
|
|
|
I have also tried it this way
$('form#Commission #Commission_On').formCalc(" Nett_Earnings -Actual_Takings >0?0",{ currency_format:true, mirror:'sfm_Commission_On_parsed'}); however that then means no output to the box at all.
|
|
|
|
|
That is not Java; that is JavaScript.
Despite the similar names, they are two completely different languages.
There is a specific forum for JavaScript questions:
JavaScript Discussion Boards[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Thanks for replying, I will ask in the correct place. 
|
|
|
|
|
hi guys, I was wondering if someone could help me write a search function that looks for a string in a hashtable. iv been struggling with this part of my assignment. iv done all the inserts parts and hash function itself.
|
|
|
|
|
You need to explain the problem in more detail. What is wrong with a simple loop that compares the search string with each item in a list?
|
|
|
|
|
hi Richard,
thank you for replying. So the hash table implementation stores simple String data items, so we can only track if an item is in the data structure or not. The find function, determines if the string is in the data the hash table or not. The program loads the test dataset into the data structure, then performs find operations on all the test data items, followed by find operations on a disjoint set of unseen data items.
Iv been able to code the hash component, its just the search part that I'm not too sure of.
this is my hash function
public int hash ( String s )
{
int sum = 0;
for(int=0, i<s.length(); i++)
{sum +=((int)string.charAt(i))%size;}
return sum %size;
}
my find function would resembles something along these lines.
boolean find ( String s )
{
boolean found = false;
int value = hashFunction(s, size);
return found;
}
modified 17-May-20 5:15am.
|
|
|
|
|