Solved

Label on an etched JPanel

Posted on 2004-03-22
4
287 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
groupNoAdj 7 95
oracle 11g 23 78
configure dependency in POM for new database 3 25
What's wrong with this code? 4 22
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

786 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