Top "Jpanel" questions

JPanel is a container in the Java Swing Framework that allows custom rendering using layout managers.

setting horizontal and vertical margins

What is the method to set horizontal and vertical margins in a panel? (The same we have in html style="…

java swing jpanel margins
MouseListener/KeyListener not working (JPanel)

I'm doing a little project that involves the mouse and key listeners in JPanel. Unfortunately, none of the methods are …

java swing jpanel keylistener mouselistener
Get location of a swing component

I have put some JPanels into another JPanel which its' layout is Box Layout and Y-Axis. After I have put …

java swing jpanel layout-manager
Java JTextArea that auto-resizes and scrolls

I have a JTextArea in a JPanel. How can I have the JTextArea fill the whole JPanel and resize when …

java swing jpanel autoresize jtextarea
Put a JTextfield on a JPanel?

Why the textfield is not appearing on my panel which is inside my frame? I mean is there some additional …

java swing jpanel layout-manager null-layout-manager
Is there any way to force GridLayout to leave empty cells?

I have a JTabbedPane with 2 JPanels set to GridLayout(13, 11). The first JPanel has enough of the cells filled out that …

java swing jpanel layout-manager grid-layout
adding JLayeredPane to JPanel

I am trying to add a JLayeredPane to a JPanel and then add an image (JLabel icon) and a button …

java jpanel jlayeredpane
How to add scrollbar to panel in java, without borderlayout?

Here is my code: //this is a JPanel, the gray panel behind the A4 paper public Panel(int w, int …

java swing layout jpanel jscrollbar
Set size of jpanel on a JFrame explicitly

I have JPanel with a border, the problem is that when I add the panel on the JFrame it takes …

java swing jpanel layout-manager preferredsize
Java JPanel getGraphics()

Since Java only supports single inheritance, I desire to paint directly on an instance of a JPanel that is a …

java swing graphics jpanel paintcomponent