📄 workframe.java
字号:
import java.awt.BorderLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
public class workFrame extends JFrame{
private JPanel textPanel,buttonPanel;
private JScrollPane inTestPane, outTextPane;
private JTextArea inTextArea,outTextArea;
private JButton inButton,clearButton;
public workFrame(){
setSize(400,400);
setLocation(200,200);
textPanel = new JPanel();
inTextArea = new JTextArea();
inTestPane = new JScrollPane(inTextArea);
outTextArea = new JTextArea();
outTextPane = new JScrollPane(outTextArea);
// outTextArea.setBackground(new Color(100,100,0));
outTextArea.setEditable(false);
textPanel.setLayout(new GridLayout(2,1));
textPanel.add(inTestPane);
textPanel.add(outTextPane);
buttonPanel = new JPanel();
inButton = new JButton("Input");
clearButton = new JButton("Clear");
buttonPanel.setLayout(new GridLayout(2,1));
buttonPanel.add(inButton);
buttonPanel.add(clearButton);
setLayout(new BorderLayout());
getContentPane().add(textPanel,"Center");
getContentPane().add(buttonPanel,"East");
setVisible(true);
}
public JButton getInButton(){
return inButton;
}
public JButton getClearButton(){
return clearButton;
}
public JTextArea getInTextArea(){
return inTextArea;
}
public JTextArea getOutTextArea(){
return outTextArea;
}
// public static void main(String[] argv){
// workFrame myFrame = new workFrame();
// myFrame.setVisible(true);
// }
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -