jsplitpane

Need the height of an invalidated Swing component

给你一囗甜甜゛ 提交于 2019-11-30 04:48:17
问题 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 "default" window configuration. The default height of the window is the desktop height, and the default divider location is 100 pixels from the bottom of the split pane. To set the divider location to 100px, I take the JSplitPane height - 100. The problem

How to set JSplitPane-Divider collapse/expand State?

孤人 提交于 2019-11-29 14:35:27
问题 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 the oneTouchExpandable UI-Widget then I store only the 'int'-Position on dispose and set the 'int'-Position back again with the consequence on JFrame-resizing the JSplitPane-Divider jumps to the collapsed Component preferredSize. How can I get/set the

Making a JPanel manually resizable

↘锁芯ラ 提交于 2019-11-29 12:24:41
问题 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 way you know that I can do this? 回答1: In order to make panels in a frame individually resizable you need to add them onto a JSplitPane. Instead of putting it in the South portion of the Frame, put the JSplitPane in the Center. The split pane will

Setting divider location on a JSplitPane doesn't work

别来无恙 提交于 2019-11-27 15:06:47
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 class JSplitProblem extends JFrame { public JSplitProblem(){ JPanel upperPanel = new JPanel(); upperPanel.setLayout(new BoxLayout(upperPanel, BoxLayout.X_AXIS)); JPanel leftPanel = new JPanel(); leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.Y_AXIS)); JPanel red = new JPanel(); red.setBackground(Color.red); leftPanel.add(red); JPanel rightPanel =

Setting divider location on a JSplitPane doesn't work

拟墨画扇 提交于 2019-11-26 17:01:05
问题 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 class JSplitProblem extends JFrame { public JSplitProblem(){ JPanel upperPanel = new JPanel(); upperPanel.setLayout(new BoxLayout(upperPanel, BoxLayout.X_AXIS)); JPanel leftPanel = new JPanel(); leftPanel.setLayout(new BoxLayout(leftPanel, BoxLayout.Y