jlayeredpane

Swing JLayeredPane.getLayer() - Documentation error or actual side effect?

I'm trying to figure something out about JLayeredPane in Swing. If anyone has used this class, feedback would be appreciated. The documentation for getLayer(JComponent c) states: Gets the layer property for a JComponent, it does not cause any side effects like setLayer(). (painting, add/remove, etc) Normally you should use t...

Do you have printing problems when using a JLayeredPane?

I am currently using a JLayeredPane to display a bowling ball in the background and then put JTextField's on top of the image that represent certain measurements that a bowling pro-shop worker would use to drill the holes in bowling balls. I am trying to let the user print the bowling ball with the measurement fields on a piece of paper....

How to add a JLabel on the DRAG_LAYER under the mouseDragged event

Hi everyone, I am currently working on a drag n drop application and I would really like to know what's happening inside the JLayeredPane and I get a particular program behaviour... Here's the deal: I have a chessboard placed on the DEFAULT_LAYER. I also have a chessPiece which I'd like to be added to the DRAG_LAYER when I move it. B...

adding JLayeredPane to JPanel

I am trying to add a JLayeredPane to a JPanel and then add an image (JLabel icon) and a button to the JLayeredPane, but neither show up. I've tested the image without the button and the layeredpane so I know that works. Here is some of the code I am using. Is there something I am missing or doing wrong? public class MyClass extends...

Java: Draw Lines on a JMF Lightweight_Rendered Player

Hello, I've got a problem: I have a JMF-Videoplayer in my application and I want to draw on it (while the video continues). The Problem I've got is that I use a JLayeredPane where I add the VideoPlayer-Control on Layer.Content_Layer(index 0) and a JPanel (setOpaque(false)) on Layer.Modal_Layer(index 300). What happens is, when I add th...

Use case of Glass Pane vs. Layered Pane

I've always been a little fuzzy on the difference between the glass pane and a layered pane. Is the glass pane essentially just "the very top layer of the root pane," or does it behave differently? When would you use a layered pane instead of the glass pane? ...

Java Swing NullPointerException when drawing

I'm using a custom JLayeredPane. I have several Shapes which needed to be drawn on different layers in the JLayeredPane. To test this I create a JPanel and ask its graphics. Then I draw a test rectangle on that JPanel (preparing the graphics) and in my paintComponent method from the JLayeredPane I finally draw everything. But this fail...

Adding a JTable to a layeredPane

Can we add a JTable to a JLayeredPane in Java? ...

Transarent background over heavyweight components

I've got a problem. In LayeredPane I have 2 components: heavyweight coponent and JComponent(or any other what I could draw text in) that is placed above the first one. I'd like JComponent to have transparent background, but it has black background. Heavyweight coponent is a component that renders video and JComponent is component what I ...

Unable to set mouse cursor JLayeredPane

I'm running into a problem that I can't seem to figure out nor find the answer anywhere on the web. I've got a JLayeredPane and when it only has one child Panel I am able to correctly set the cursor using setCursor(). The cursor shows up and everything is fine. But when I add an additional JPanel into the JLayeredPane the cursor no long...

Is there a limit to the amount of layers for a JLayeredPane in java ?

Hi, I have a java application for an ATC. I just got started with the GUI. First I have a Mainframe, a JLayeredPane on this mainframe, and panels with labels(having ImageIcons) inside them on the JLayeredPane. I have successfully added about 4 panels(panels have labels,and labels have imageicons) to the JLayeredPane. When I go to add t...

Java swing jLayeredPane

I have an code that adds jbutton on the clicked place in the jLayeredpane on mouse click. Now the problem is on resize. When i dont change the size of jLayeredpane on runtime there is no problem. When i maximize the window and i have made it as, the jLayeredpane will adjust to fit the screen so when i add a button on the jpane now and wh...