首页 > 编程语言 >JavaSwing SplitPane

JavaSwing SplitPane

时间:2024-12-21 20:21:36浏览次数:5  
标签:jFrame JFrame splitPane SplitPane 窗体 设置 new JavaSwing

try
        {
            BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.osLookAndFeelDecorated;
            //UIManager.put("RootPane.setupButtonVisible", false);
            org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF();
            
        }
        catch(Exception e)
        {
            //TODO exception
        }
        
        // 创建窗体对象
        JFrame jFrame =new JFrame();
        // 设置窗体大小
        jFrame.setSize(800, 500);
        // 设置窗体全屏展示
        //jFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
        // 设置窗体显示位置
        //jFrame.setLocation(100,200);
        // 设置窗体显示正中间
        jFrame.setLocationRelativeTo(null);
        // 设置窗体标题
        jFrame.setTitle("窗体标题");
        // 设置窗体不可全屏显示
        //jFrame.setResizable(false);
        // 设置窗体关闭后退出程序
        jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        //设置此窗口是否应该始终位于其他窗口上方
        jFrame.setAlwaysOnTop(true);
        // 设置窗体图标
        jFrame.setIconImage(new ImageIcon(HelloWorld.class.getResource("/images/book.png")).getImage());
        

        // 创建分割面板
        JSplitPane splitPane =new JSplitPane();
        
        // 设置左右组件
        splitPane.setLeftComponent(new JButton("left"));
        
        splitPane.setRightComponent(new JButton("right"));
        
        // 设置快速关闭
        splitPane.setOneTouchExpandable(true);
        // 设置拖动连续绘制
        splitPane.setContinuousLayout(false);
        
        // 设置分割条宽度
        splitPane.setDividerSize(30);
        // 设置分割位置
        splitPane.setDividerLocation(100);
        
        // 将分割面板添加到窗口中
        jFrame.setContentPane(splitPane);
        
        // 设置窗体可见
        jFrame.setVisible(true);
            

 

标签:jFrame,JFrame,splitPane,SplitPane,窗体,设置,new,JavaSwing
From: https://www.cnblogs.com/liangqingyun/p/18621117

相关文章

  • JavaSwing FileInput
    try{BeautyEyeLNFHelper.frameBorderStyle=BeautyEyeLNFHelper.FrameBorderStyle.osLookAndFeelDecorated;//UIManager.put("RootPane.setupButtonVisible",false);org.jb2011.lnf.beautyeye.BeautyEyeLNFHelpe......
  • JavaSwing Dialog
    try{BeautyEyeLNFHelper.frameBorderStyle=BeautyEyeLNFHelper.FrameBorderStyle.osLookAndFeelDecorated;//UIManager.put("RootPane.setupButtonVisible",false);org.jb2011.lnf.beautyeye.BeautyEyeLNFHelpe......
  • JavaSwing JTree
    packagecom.java.view;importjava.awt.Color;importjava.awt.Cursor;importjava.awt.Dimension;importjava.awt.FlowLayout;importjava.awt.Font;importjava.awt.event.ActionEvent;importjava.awt.event.ActionListener;importjava.awt.event.ItemEvent;......
  • JavaSwing JCombox
    try{BeautyEyeLNFHelper.frameBorderStyle=BeautyEyeLNFHelper.FrameBorderStyle.osLookAndFeelDecorated;//UIManager.put("RootPane.setupButtonVisible",false);org.jb2011.lnf.beautyeye.BeautyEyeLNFHelpe......
  • JavaSwing JList
    try{BeautyEyeLNFHelper.frameBorderStyle=BeautyEyeLNFHelper.FrameBorderStyle.osLookAndFeelDecorated;//UIManager.put("RootPane.setupButtonVisible",false);org.jb2011.lnf.beautyeye.BeautyEyeLNFHelpe......
  • JavaSwing JSlider
    try{BeautyEyeLNFHelper.frameBorderStyle=BeautyEyeLNFHelper.FrameBorderStyle.osLookAndFeelDecorated;//UIManager.put("RootPane.setupButtonVisible",false);org.jb2011.lnf.beautyeye.BeautyEyeLNFHelpe......
  • JavaSwing JProcessBar
    try{BeautyEyeLNFHelper.frameBorderStyle=BeautyEyeLNFHelper.FrameBorderStyle.osLookAndFeelDecorated;//UIManager.put("RootPane.setupButtonVisible",false);org.jb2011.lnf.beautyeye.BeautyEyeLNFHelpe......
  • JavaSwing JRadioButton
    try{BeautyEyeLNFHelper.frameBorderStyle=BeautyEyeLNFHelper.FrameBorderStyle.osLookAndFeelDecorated;//UIManager.put("RootPane.setupButtonVisible",false);org.jb2011.lnf.beautyeye.BeautyEyeLNFHelpe......
  • JavaSwing JCheckBox
    try{BeautyEyeLNFHelper.frameBorderStyle=BeautyEyeLNFHelper.FrameBorderStyle.osLookAndFeelDecorated;//UIManager.put("RootPane.setupButtonVisible",false);org.jb2011.lnf.beautyeye.BeautyEyeLNFHelpe......
  • JavaSwing JTextArea
    try{BeautyEyeLNFHelper.frameBorderStyle=BeautyEyeLNFHelper.FrameBorderStyle.osLookAndFeelDecorated;//UIManager.put("RootPane.setupButtonVisible",false);org.jb2011.lnf.beautyeye.BeautyEyeLNFHelpe......