JSplitPane.setResizeWeight(int v)
试试
试试
解决方案 »
- 请问能在GridLayout的指定位置添加一个组件吗?
- java如何编写C/S模式下的网络数据库程序
- java 操作mysql数据库问题
- 请教一个 JSF,managed-bean.xml配置问题
- Process process=Runtime.getRuntime().exec("");中产生停滞(阻塞,blocking),怎么解决?
- 为何int len=InputStream.read(temp[],begin,length)不返回-1?
- 如何使用jdk开发java程序(初级)100分,在线给分
- 新手,刚学接口和继承,求类图设计!
- Utilities.getIcon属于那一个package?
- 那里可以下载jb5 或jb6 的企业版 for linux?先谢谢了
- 我在主窗口上,添加一个菜单栏和jpanel,删除jpanel,然后再添加一个jpanel。结果主窗口上的菜单栏和关闭窗口点击不起作用了。希望大神给指点一下。
- sql语句转化为hql语句
package com.fxxc.test;import java.awt.BorderLayout;
import java.awt.EventQueue;import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;public class FrameTest extends JFrame { private JPanel contentPane; /**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
PanelTest panel = new PanelTest();
FrameTest frame = new FrameTest();
frame.add(panel);
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
} /**
* Create the frame.
*/
public FrameTest() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
contentPane.setLayout(new BorderLayout(0, 0));
setContentPane(contentPane);
}}
package com.fxxc.test;import javax.swing.JPanel;
import java.awt.GridBagLayout;
import javax.swing.JSplitPane;
import java.awt.GridBagConstraints;public class PanelTest extends JPanel { /**
* Create the panel.
*/
public PanelTest() {
GridBagLayout gridBagLayout = new GridBagLayout();
gridBagLayout.columnWidths = new int[]{0, 0};
gridBagLayout.rowHeights = new int[]{0, 0, 0, 0, 0};
gridBagLayout.columnWeights = new double[]{1.0, Double.MIN_VALUE};
gridBagLayout.rowWeights = new double[]{0.0, 0.0, 0.0, 1.0, Double.MIN_VALUE};
setLayout(gridBagLayout);
JSplitPane splitPane = new JSplitPane();
GridBagConstraints gbc_splitPane = new GridBagConstraints();
gbc_splitPane.gridheight = 4;
gbc_splitPane.fill = GridBagConstraints.BOTH;
gbc_splitPane.gridx = 0;
gbc_splitPane.gridy = 0;
add(splitPane, gbc_splitPane);
JSplitPane splitPane_1 = new JSplitPane();
splitPane.setLeftComponent(splitPane_1); }}