0

I am facing a rather unclear situation in one of my java courses. The situation is as follows;

Given is the image of a JFrame consisting of 2 labels, 1 textfield and 2 buttons.

The question asked on the test is: "give the complete java code for all of the attributes, note that you do not have to write the main function and the constructor for this frame". What is meant with the attributes within this frame ? my guess would be the JLabel, Jtextfield and the Jbutton.

am I correct on this ? and if not, how am I supposed to answer these kind of questions ? would I only need to declare the name of the different elements such as:

private JLabel label1, label2;

private JTextfield text1;

private JButton but1, but2;

as far as I know this is the only code segment refering to the attributes of this frame that is outside of the constructor.

Any help would be greatly appreciated!

Community
  • 1
  • 1
Mark Stroeven
  • 676
  • 2
  • 6
  • 24
  • I'd think you'd also need to construct the items, pass their constructors the appropriate strings, etc. But it's definitely not clear from your question. – jedwards Sep 24 '13 at 22:34
  • Read here about attributes: http://stackoverflow.com/questions/8479038/what-is-attribute-in-java – Costis Aivalis Sep 24 '13 at 22:36

0 Answers0