But what if I have more buttons?
I have 1 HButton, named 'button' on a 'JDialog' named 'dialog', and anotther JButton named 'queryButton' on a 'JDialog' named 'queryDialog'.
I changed the...
Type: Posts; User: hooshdar3
But what if I have more buttons?
I have 1 HButton, named 'button' on a 'JDialog' named 'dialog', and anotther JButton named 'queryButton' on a 'JDialog' named 'queryDialog'.
I changed the...
OK, but I have asked my question already
Heh!unbelievable!I haven't done that!
OK, I added that line, and now get the compile error:
Hi.
I set an action listener for my button but nothing happens when the button is clicked.Why?
Here is my code:
public class sysinfoHooshi implements ActionListener{
static JTextField tf =...
Why is it that your ActionListener is not followed by a pair of parentheses, and are followed by a pair of braces instead?
What do you mean?
I declare them as e.g:
public static final JTextField tf = new JTextField("") outside any function? then what happens when the user chabges their content? Will
tf.getText()...
The end-user is supposed to enter numbers in the text-fields. Doesn't Final make them unchangable? What about private?
I asked because then the TextFields will not be known in the function actionPerformed()
Do I have to put the code inside a function?
N.B:Should the second line be:
btn.addActionListener( new ActionListener() )?
It is the topic of this topic
No.I meant I want the last two lines onward be executed then. there is processing code not shown here.
Again, the last two lines are:
int simTime = Integer.parseInt( tf.getText() );;
int...
Before the last two lines.
--- Update ---
But this way, there is no way to distinguish between different events for one component, isn't it?
Hi.
I have created a modal dialog box thus:
JDialog dialog = new JDialog();
dialog.setModal(true);
dialog.setSize(400, 150);
dialog.setTitle("Input dialog");