Questions tagged [jsplitpane]

JSplitPane is a java swing component used to divide two (and only two) components.

JSplitPane is a java swing component used to divide two (and only two) Components. The two Components are graphically divided based on the look and feel implementation, and the two Components can then be interactively resized by the user.

195 questions
19
votes
2 answers

Detecting JSplitPane Divider Movement

Is there a way to detect when a JSplitPane divider is moved? Is there a way to add a listener for divider movement? JPanel panel1 = new JPanel(); JPanel panel2 = new JPanel(); JSplitPane sp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, panel1,…
Adude11
  • 605
  • 5
  • 16
15
votes
10 answers

JSplitPane SetDividerLocation Problem

I have a JSplitPane which when shown should split the pane by 50%. Now on giving an argument of 0.5 (as suggested) to setDividerLocation, Java seems to treat it as a normal number instead of a percentage. As in, the divider, instead of going to the…
Goutham
  • 2,759
  • 9
  • 30
  • 36
15
votes
5 answers

Making a JPanel manually resizable

I have a JFrame with BorderLayout as the layout manager. In the south border, I have a JPanel, I want this JPanel's size to be adjustable by the user, i.e. the user can click on the edge of the border and drag it up to make it larger. Is there any…
saralk
  • 333
  • 1
  • 3
  • 9
14
votes
4 answers

Setting divider location on a JSplitPane doesn't work

I'm trying to set the divider location of a JSplitPane but it seems not to work. Here's an SSCCE: import java.awt.Color; import javax.swing.BoxLayout; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.JSplitPane; public…
Heisenbug
  • 38,762
  • 28
  • 132
  • 190
10
votes
7 answers

How to set JSplitPane-Divider collapse/expand State?

I have a JFrame with a JSplitPane that is OneTouchExpandable. I want to remember the last Divider position of the JSplitPane on JFrame dispose and restore the Position if the JFrame is reopened. It works well, but if the User expand one Side via…
oliholz
  • 7,447
  • 2
  • 43
  • 82
8
votes
2 answers

JTable#scrollRectToVisible in combination with JSplitPlane shows the wrong row

When I call JTable#scrollRectToVisible, the row I want to show is hidden underneath the header in certain situations. The rest of this question only makes sense when using the following code. This is a very simply program which I use to illustrate…
Robin
  • 36,233
  • 5
  • 47
  • 99
8
votes
3 answers

Resizing issue with canvas within jscrollpane within jsplitpane

I'm creating an application using the NetBeans GUI Editor, in which I want to have a JSplitPane, the top component of which will be a Canvas within a JScrollPane and the bottom component will be a JTextArea, or something like that. When I pull the…
Sakis Vtdk
  • 489
  • 6
  • 12
7
votes
6 answers

how can you programmatically set the JSplitPane to hide the right/bottom component when OneTouchExpandable is set to true?

In a JSplitPane, you have the setOneTouchExpandable method which provides you with 2 buttons to quickly fully hide or full show the JSplitPane. My question is how can you programmatically "click" the hide button on the JSplitPane? I may have wrongly…
Adel Boutros
  • 10,205
  • 7
  • 55
  • 89
7
votes
6 answers

JSplitPane: is there a way to show/hide one of the panes?

I have a JSplitPane with two components, A and B, but sometimes I want to be able to hide B, so that either of the following are true: components A and B are visible in the JSplitPane only component A is visible in the space occupied by the…
Jason S
  • 184,598
  • 164
  • 608
  • 970
7
votes
2 answers

Adjusting size of JPanels in JSplitPane

Trying to create a JSplitPane with two JPanels. With the following code: JTable table = new JTable(qualifierModel); table.setDefaultEditor(String.class, new QualifierCellEditor()); JPanel qualiferPanel = new JPanel(); JScrollPane jp = new…
Arun
  • 1,176
  • 5
  • 20
  • 48
6
votes
4 answers

Need the height of an invalidated Swing component

The basic setup is this: I have a vertical JSplitPane that I want to have a fixed-size bottom component and a resizing top component, which I accomplished by calling setResizeWeight(1.0). In this application there is a button to restore the…
Kevin K
  • 9,344
  • 3
  • 37
  • 62
6
votes
2 answers

Allow nested JSplitPanes to control parent JSplitPanes

Below is the code for a simple layout created using several nested JSplitPanes. import java.awt.Color; import java.awt.Dimension; import java.awt.GridLayout; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import…
Dan
  • 7,286
  • 6
  • 49
  • 114
6
votes
5 answers

Why does JSplitPane add a border to my components, and how do I stop it?

JSplitPane seems to add a border to any Component added to it. This is most visible with nested JSplitPanes - e.g.: public class JSplitPaneToy { public static void main(String[] args) { JSplitPane sp = new…
amaidment
  • 6,942
  • 5
  • 52
  • 88
6
votes
1 answer

How do I customize a JSplitPane divider and maintain one-touch arrow functionality?

So, my problem boils down to this... The default dividers are kind of ugly, plus I would like to add a label to it (in the I-want-text-on-it sense, not in the "adding a JLabel to its layout" sense). I see that you can change the border on the split…
Cary Young
  • 85
  • 1
  • 6
6
votes
3 answers

How to get the dimensions of the visible part of the JScrollPane-based window

This JScrollPane based window is a top part of the JSplitPane. getBounds(), getWidth(), getHeight() all return the full size of the window, including the invisible (scrollable) part. I want to know the dimensions of the visible part only.
Flot2011
  • 4,601
  • 3
  • 44
  • 61
1
2 3
12 13