Solved

Label on an etched JPanel

Posted on 2004-03-22
4
288 Views
Last Modified: 2012-05-04
Anyone know how to put a label on an etched JPabel or something similar to a frame in VB? I think.
0
Comment
Question by:dwaneos
  • 3
4 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 10648788
panel.add(new JLabel("i'm a label!"));
0
 

Author Comment

by:dwaneos
ID: 10648857
Nope, want it embedded into the jpanel on just on top of it.
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 50 total points
ID: 10648883
Override paintComponent in JPanel subclass


public void paintComponent(Graphics g) {
      super.paintComponent(g);
      g.drawString("I'm a label!", 10, 10);
}
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10649068
8-)
0

Featured Post

Industry Leaders: 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

Suggested Solutions

Title # Comments Views Activity
expectj telnet failing 5 49
How  can  i  resolve  HTTP Status 404 -? 8 58
junit example issue 2 22
Java array sort 10 26
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
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 video teaches viewers about errors in exception handling.

679 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