📄 frame1.java
字号:
package controlline;import java.awt.*;import java.awt.event.*;import javax.swing.*;//import com.borland.jbcl.layout.*;import java.lang.*;public class Frame1 extends JFrame { JPanel contentPane; Panel1 mypanel; BorderLayout borderLayout1 = new BorderLayout(); //Construct the frame public Frame1() { enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } //Component initialization private void jbInit() throws Exception { contentPane = (JPanel) this.getContentPane(); contentPane.setLayout(borderLayout1); this.setSize(new Dimension(600, 400)); this.setTitle("Frame Title"); mypanel=new Panel1(); mypanel.setBackground(Color.lightGray); mypanel.setForeground(Color.red); contentPane.add(mypanel, BorderLayout.CENTER); // this.add(mypanel,"center"); /* GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice gd = ge.getDefaultScreenDevice(); FullScreenWindow myWindow = new FullScreenWindow(); if ( gd.isFullScreenSupported() ) gd.setFullScreenWindow(myWindow);*/ } //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); } }}/*class FullScreenWindow extends JWindow { public FullScreenWindow(){ this.addMouseListener(new MouseAdapter(){ public void mousePressed(MouseEvent evt){ quit(); } }); } public void quit(){ this.dispose(); } public void paint(Graphics g) { g.setFont(new Font("Arial",Font.BOLD,30)); g.setColor(Color.RED); g.drawString("这是全屏幕模式",100,100); }}*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -