Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

writing text on JPanel

Posted on 2010-11-10
4
Medium Priority
?
839 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 668 total points
ID: 34107673
Add a JLabel to it and call setText on it
0
 
LVL 7

Assisted Solution

by:rodness
rodness earned 668 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 664 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

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…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

885 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