Solved

writing text on JPanel

Posted on 2010-11-10
4
820 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

739 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