frame1.java~6~
来自「java灵感设计」· JAVA~6~ 代码 · 共 67 行
JAVA~6~
67 行
package jeditorapp;import java.awt.*;import java.awt.event.*;import javax.swing.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: </p> * @author unascribed * @version 1.0 */public class Frame1 extends JFrame { JPanel contentPane; BorderLayout borderLayout1 = new BorderLayout(); JSplitPane jSplitPane1 = new JSplitPane(); JSplitPane jSplitPane2 = new JSplitPane(); JScrollPane jScrollPane1 = new JScrollPane(); JTree jTree1 = new JTree(); JScrollPane jScrollPane2 = new JScrollPane(); JEditorPane jEditorPane1 = new JEditorPane(); JScrollPane jScrollPane3 = new JScrollPane(); JEditorPane jEditorPane2 = new JEditorPane(); //Construct the frame public Frame1() { enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } //Component initialization private void jbInit() throws Exception { //setIconImage(Toolkit.getDefaultToolkit().createImage(Frame1.class.getResource("[Your Icon]"))); contentPane = (JPanel) this.getContentPane(); contentPane.setLayout(borderLayout1); this.setResizable(false); this.setSize(new Dimension(320, 313)); this.setTitle("Frame Title"); jEditorPane1.setAlignmentX((float) 1.0); jEditorPane1.setAlignmentY((float) 1.0); jEditorPane1.setText("jEditorPane1"); jEditorPane2.setAlignmentX((float) 10.0); jEditorPane2.setText("jEditorPane2"); jSplitPane1.add(jScrollPane1, JSplitPane.LEFT); jSplitPane1.add(jScrollPane2, JSplitPane.RIGHT); contentPane.add(jSplitPane2, BorderLayout.SOUTH); jSplitPane2.add(jScrollPane3, JSplitPane.LEFT); jScrollPane3.getViewport().add(jEditorPane2, null); jScrollPane2.getViewport().add(jEditorPane1, null); jScrollPane1.getViewport().add(jTree1, null); contentPane.add(jSplitPane1, BorderLayout.CENTER); } //Overridden so we can exit when window is closed protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); if (e.getID() == WindowEvent.WINDOW_CLOSING) { System.exit(0); } }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?