• Post Reply Bookmark Topic Watch Topic
  • New Topic

GUI- Beginner............ myWindow.getContentPane().add(myLabel)?? explain please  RSS feed

 
Nadine Ernest
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Today was my first day to start GUI, im still trying to understand it

i have a problem,,
what does this mean?!!



i dont understand the second line what does it do?!
what is the ?!! what is it supposed to do and the ??


please be clear because today is my first day in graphic user interface!
thank youuu soo much!!
 
Aniruddh Joshi
Ranch Hand
Posts: 275
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JLabel javadoc
 
Campbell Ritchie
Sheriff
Posts: 55351
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using Java5 or Java6? In which case you forget about getContentPane().

Just write add(xxx). Explanation in the Java™ Tutorials here. Read the bit about "add has been overridden".

You need a trip to the Java™ Tutorials; look for the two sections headed Swing and Creating a GUI. You will probably want to start with the bits about top-level containers. If you can't understand anything pleas ask again.

This sort of thing is usually discussed in the Swing forum, so I shall move you.
 
Campbell Ritchie
Sheriff
Posts: 55351
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you got anywhere with it?

One additional point.

Remembering what it said in the Java Tutorials when I looked this morning: Don't try to learn using the Matisse tool in NetBeans.
 
Nadine Ernest
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ritchie,
yeah im starting to get better with it!!
please check out my other question....i wrote the gui code but it gives me an error....here is the link:
http://www.coderanch.com/t/444442/Swing-AWT-SWT-JFace/java/GUI-really-beginner-error

thanks sooo much for your help!
dont worry i would never use netbeans or eclipse or any of that sophisticated software!!
im using JCreator!!
its really good actuallly!!!

waiting for your reply on my other question!!
 
Campbell Ritchie
Sheriff
Posts: 55351
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
By all means try JCreator, NetBeans or Eclipse. I personally prefer Eclipse.

But don't, at this stage, use any automated tools to write your GUI code. Write it all by hand.

I am looking at your other thread; I see Maneesh has already diagnosed one problem.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!