Solved

writing text on JPanel

Posted on 2010-11-10
4
803 Views
Last Modified: 2012-05-10
Now nothing can't be more basic. :(

But still not able to figure out how can I write text on JPanel.

Thanks !
0
Comment
Question by:hipal
  • 2
4 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 167 total points
Comment Utility
Add a JLabel to it and call setText on it
0
 
LVL 7

Assisted Solution

by:rodness
rodness earned 167 total points
Comment Utility
You need to put your text in a JLabel, and add that into the JPanel.
0
 
LVL 92

Assisted Solution

by:objects
objects earned 166 total points
Comment Utility
have a read here

http://download.oracle.com/javase/tutorial/uiswing/components/label.html

you can also achieve it by subclassing JPanel and overriding paintComponent(). That will give you more flexibility
0
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
:-)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now