📄 splitpanetest.java
字号:
//JSplitPane
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class SplitPaneTest
{
public static void main(String args[])
{
myFrame Frame1 = new myFrame("JScrollPane Text");
Frame1.show();
Frame1.pack();
}
}
class myFrame extends JFrame
{
JTextArea text1,text2,text3;
JSplitPane split1,split2;
myFrame(String str)
{
super(str);
setSize(300,200);
text1 = new JTextArea(10,20);
text2 = new JTextArea(10,20);
text3 = new JTextArea(10,20);
split1 = new JSplitPane(JSplitPane.VERTICAL_SPLIT,true,text1,text2);
split2 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,split1,text3);
Container Conpane = getContentPane();
Conpane.add(split2,BorderLayout.CENTER);
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -