Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

String question

807600Oct 18 2007 — edited Oct 18 2007
Hi, I was wondering how to display a string in a jPanel. I've tried using a JLabel, but I've been unsuccessful in printing out my line of string. This is one of my attempts:

JLabel winnerText = new JLabel("Winner");
winnerText.getText();

I'm not really sure if this is the way to do it, but I couldn't find anything better in the java documentation.

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Nov 15 2007
Added on Oct 18 2007
1 comment
83 views