📄 mainframe.java
字号:
package yaokun.yuki.guangshi;import javax.swing.*;import java.awt.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2003</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class MainFrame extends JFrame { ButtonScrollPane panel = new ButtonScrollPane(ButtonScrollPane.ONELINE_MODE); YKButton jButton1 = new YKButton(); YKButton jButton2 = new YKButton(); YKButton jButton3 = new YKButton(); YKButton jButton4 = new YKButton(); YKButton jButton5 = new YKButton(); YKButton jButton6 = new YKButton(); YKButton jButton7 = new YKButton(); YKButton jButton8 = new YKButton(); YKButton jButton9 = new YKButton(); YKButton jButton10 = new YKButton(); YKButton jButton11 = new YKButton(); YKButton jButton12 = new YKButton(); public MainFrame() { try { jbInit(); this.setSize(500,300); this.setVisible(true); } catch(Exception e) { e.printStackTrace(); } } public static void main(String[] args) { MainFrame mainFrame = new MainFrame(); } private void jbInit() throws Exception { this.setDefaultCloseOperation(EXIT_ON_CLOSE); this.setState(Frame.NORMAL); this.getContentPane().add(panel, BorderLayout.NORTH); //jButton1.setBorder(null); ////jButton1.setBorderPainted(true); jButton1.setIcon(new ImageIcon("pic/1.gif")); //jButton2.setBorder(null); //jButton2.setBorderPainted(true); jButton2.setIcon(new ImageIcon("pic/2.gif")); jButton3.setBorder(null); jButton3.setIcon(new ImageIcon("pic/3.gif")); //jButton4.setBorder(null); jButton4.setIcon(new ImageIcon("pic/4.gif")); //jButton5.setBorder(null); jButton5.setIcon(new ImageIcon("pic/5.gif")); //jButton6.setBorder(null); jButton6.setIcon(new ImageIcon("pic/6.gif")); //jButton7.setBorder(null); jButton7.setIcon(new ImageIcon("pic/7.gif")); jButton10.setIcon(new ImageIcon("pic/2.gif")); jButton11.setIcon(new ImageIcon("pic/4.gif")); jButton12.setIcon(new ImageIcon("pic/2.gif")); //jButton8.setBorder(null); jButton8.setIcon(new ImageIcon("pic/8.gif")); //jButton9.setBorder(null); jButton9.setIcon(new ImageIcon("pic/9.gif")); YKButton buts[]={ jButton1,jButton2,jButton3,jButton4,jButton5,jButton6,jButton7,jButton8,jButton9,jButton10 ,jButton11,jButton12 }; panel.setButton(buts); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -