Solved

writing text on JPanel

Posted on 2010-11-10
4
826 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

623 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