Right now my output is like this:
2, 4, 6, 8, 10,
What I want:
2, 4, 6, 8, 10
PrintWriter fout = new PrintWriter(new BufferedWriter(new FileWriter("numbers.dat")));
...
Type: Posts; User: fride360
Right now my output is like this:
2, 4, 6, 8, 10,
What I want:
2, 4, 6, 8, 10
PrintWriter fout = new PrintWriter(new BufferedWriter(new FileWriter("numbers.dat")));
...
Right now when the program runs there is a button that says "Add Customer". When it is pressed it brings up another GUI where someone can enter info. After they click out of that box and click...
This is the error. A while back I got an error that turned out that I had some classes spelled different. One of them was "VolCac" as stated below. I have since then changed it, so I'm not sure...
It is a pretty lengthy code. I am getting an error at this line:
public class VolCalc extends JFrame implements ActionListener{
Here is all of the code:
import java.awt.*;
import...
I’ve started to create a GUI that consists of a few tabs. Right now I am focusing on two of them. The Pool tab and the Hot Tub tab. When I first started I got everything to work fine on the pool tab....
I figured it out.
My code isn't running and I know I have brackets in the wrong places.
import java.util.Calendar;
public class Date {
private int month;
private int day;
private int year;
What the code is supposed to do is if the user does not enter an odd number it asks to do it again. Then if an odd number is entered it creates a diamond pattern.
Right now If I enter an even...
I would like for my code below to display the word middle right below the word top. I can't figure out how to do this.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
...
Thanks, that's what I was trying to do. How do you name the tab?
import javax.swing.*;
import javax.swing.JLabel;
import javax.swing.plaf.metal.MetalIconFactory;
public class Alignment {
protected JTabbedPane tabPane;
public Alignment() {
tabPane =...
I did check it out. I'm not sure how to do it.
I'm sorry, but I don't know how to post in SSCCE. I'm not getting any errors when I run it, it just doesn't align properly. Would it be better to post all of the code?
Thanks
I'm tryint to get my label to align top left and it aligns top center.
JLabel label1 = new JLabel("Text here", JLabel.LEFT);
label1.setVerticalAlignment(JLabel.TOP
...
Got it to work, thanks for your help.
It looks like the line
String answer = JOptionPane.showInputDialog(null, "Please enter a five digit number","Enter a number");
should not be there, but I'm not sure. Can you tell me which...
I have a code here that initially I would enter a five digit number. If the number is not equal to five an error box pops up. When I plug in a number that is not equal to five it brings up the...
Hi everyone, I'm new to programming. I find it very interesting with all you can do with it. I hope to learn a lot from my posts and what everybody brings to it.