?
Solved

Label on an etched JPanel

Posted on 2004-03-22
4
Medium Priority
?
294 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 150 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

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
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…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

599 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