Solved

writing text on JPanel

Posted on 2010-11-10
4
804 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
ID: 34107673
Add a JLabel to it and call setText on it
0
 
LVL 7

Assisted Solution

by:rodness
rodness earned 167 total points
ID: 34107680
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
ID: 34107950
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
ID: 34110238
:-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Exception after setting jdbc session management 2 52
Strange loading of website behaviour 3 32
ArrayIndexOutOfBoundException 9 68
JList custom Cell Renderer refresh 15 53
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to implement Singleton Design Pattern in Java.

863 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

27 Experts available now in Live!

Get 1:1 Help Now