0

Hi everyone,

I am new to Java and more recently Swing. I was wondering if anyone would be able to show me a way of inputting a value into a text box, and being able to use this to calculate a sum for example.

Also I am interested to know how I can disable buttons, such as radio buttons or check boxes when one has been clicked.. would I need to group these together some how?

Thanks in advance, albert :)

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by albert101
0

Hi everyone,

I am new to Java and more recently Swing. I was wondering if anyone would be able to show me a way of inputting a value into a text box, and being able to use this to calculate a sum for example.

Also I am interested to know how I can disable buttons, such as radio buttons or check boxes when one has been clicked.. would I need to group these together some how?

Thanks in advance, albert :)

Well Hi,

For inputting anything to a JTextField you need to make use of setText() method.

How?

JTextField tfd = new JTextField();
tfd.addActionListener(this);
tfd.setText("Hello world");

Do write an ActionPerformed method corresponding to an ActionListener class.

setVisible(true) or setVisible(false)
well help you in solving your remaining doubts..

Cheers

Edited by mytime19: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.