Questions tagged [jlayeredpane]

JLayeredPane is a Java Swing component that adds depth to a JFC/Swing container, allowing components to overlap each other when needed.

JLayeredPane is a Java Swing component that adds depth to a JFC/Swing container, allowing components to overlap each other when needed.
See How to Use a Layered Pane for more information.

272 questions
3
votes
3 answers

How to put a component on top of others?

I have a JScrollPanel that includes a big panel which it's self includes 3 inner panels. i want to put a panel (for example) in a special place so that always could be seen, I mean the user can scroll to anywhere wants but that panel always is in…
Soheil
  • 1,676
  • 7
  • 34
  • 65
3
votes
2 answers

Newbie JLayeredPane issue

I just can't get past square one on JLayeredPanes. (See my original question of yesterday. I have been studying the JLayeredPane tutorial and API. These tutorials are geared somewhat differently to what I am ultimately trying to produce. Going…
Steve Cohen
  • 4,679
  • 9
  • 51
  • 89
3
votes
1 answer

Transparent JPanel in JLayeredPane

I've seen several similar questions, but unfortunately the suggestions contained therein haven't quite done it for me. The overall goal: I have a slider that I want to display in the upper left of a window that mainly displays a visualization (here…
bcr
  • 1,328
  • 11
  • 27
2
votes
3 answers

Java Swing mixing panes

This seems like a newbie question except that I've been trying to wrap my head around the Swing framework for loong time. Provided you provide an image, dog.jpg, at least 500 px square, the following code should display the image in a scrollpane. …
Sunny Jim
  • 585
  • 5
  • 13
2
votes
2 answers

Adding a JPanel to a JLayeredPane causes paints and resizes to have no effect

I am trying to add a JPanel (well, several) to a JLayeredPane. However, when I do so, the paint component method of the JPanel seems to have no effect. An example is included below: import javax.swing.*; import java.awt.*; public class Example { …
James
  • 2,483
  • 2
  • 24
  • 31
2
votes
1 answer

Is this the proper way to overlay multiple components in one panel?

I'm trying to overlay a custom transparency over the top of a JPanel. I want both components to extend to the edge of the layered pane. I have overridden the paintComponent method of the top component to generally do nothing except when I want to…
Erick Robertson
  • 32,125
  • 13
  • 69
  • 98
2
votes
1 answer

Component layering Java Swing, Layers showing on hover

I have two JPanels layered on top of each other in the same container. I am using container.add(jpanel, 0); and container.add(otherjpanel, 1). It works fine however in order for the top layer to show I have to hover over the components with the…
user541597
  • 4,247
  • 11
  • 59
  • 87
2
votes
1 answer

Grab focus to a JPanel in a JLayeredPane

I have a JLayeredPane with 2 layers the first layer is a JPanel Wrapping an Image. the second layer is another object which extends JPanel called ResizableRectangle and implements KeyListener. I've overrode the KeyPressed method but it doesn't…
Bamdad Dashtban
  • 354
  • 3
  • 17
2
votes
1 answer

trying to drag something using a JLayeredPane

I'm trying to put a drag-n-drop operation into a program of mine; I found the following example that illustrates a lot of what I'm trying to do: package sandbox; import java.awt.BorderLayout; import java.awt.Color; import…
arcy
  • 12,845
  • 12
  • 58
  • 103
2
votes
1 answer

java- repaint() method is misbehaving - 2?

This question is an extension of java- repaint() method is misbehaving? (Reading it, is optional) I am working on a Music Player I am using a JSlider as seek bar and using a JLabel to draw text on screen, such as song name. I am new to…
user13824394
2
votes
3 answers

Java Swing: Clearing custom painting from a JPanel overlayed with other JPanels in a JLayeredPane

I've got a JLayeredPane containing three JPanels, two of which overlap, that I'm painting shapes to. One of the two JPanels that overlap needs to have every shape drawn to it cleared without affecting the shapes drawn to the JPanel under it…
JBenson
  • 293
  • 2
  • 5
  • 13
2
votes
1 answer

Java: JLayeredPane in Netbeans

I am using netbeans IDE to develop a GUI for a java program. I want to use a JLayeredPane in my GUI. I added a JPanel(jPanel5) and a Canvas(canvas) on two layers to my jLayeredPane and This code is generated: jPanel5.setBounds(0, 0, 749, 549); …
sajad
  • 2,094
  • 11
  • 32
  • 52
2
votes
2 answers

How to rotate a buffered image without cropping it? Is there any way to rotate a JLayeredPane or JLabel?

I had searched about it but I did not get straight forward answer. I want a buffered image to be rotated but not cropped I knew the new dimensions are gonna be some thing like this int w = originalImage.getWidth(); int h =…
mahdi
  • 184
  • 11
2
votes
1 answer

Deleting a layer in a JLayeredPane

I am currently working on a Java application that utilizes the JLayeredPane. I currently have 2 split panes in 2 different layers and I'm trying to remove one of the layers completely. How do I accomplish this?
Nathan Lam
  • 19
  • 4
2
votes
1 answer

Resize JFrame to JPanels inside JLayeredPane

I'm working on a Swing GUI using the JLayeredPane. The JFrame has a JLayeredPane which contains two JPanels. Later I want to display some components in the JPanels, I cut this part of the code to make it shorter for you. How do I resize the JFrame…
1 2
3
18 19