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

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 293
  • Last Modified:

Label on an etched JPanel

Anyone know how to put a label on an etched JPabel or something similar to a frame in VB? I think.
0
dwaneos
Asked:
dwaneos
  • 3
1 Solution
 
CEHJCommented:
panel.add(new JLabel("i'm a label!"));
0
 
dwaneosAuthor Commented:
Nope, want it embedded into the jpanel on just on top of it.
0
 
CEHJCommented:
Override paintComponent in JPanel subclass


public void paintComponent(Graphics g) {
      super.paintComponent(g);
      g.drawString("I'm a label!", 10, 10);
}
0
 
CEHJCommented:
8-)
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now