import javax.swing.ImageIcon;import javax.swing.JButton;import javax.swing.JComboBox;import javax.swing.JFrame;import javax.swing.JLabel;import javax.swing.JPanel;import java.awt.*;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.awt.event.KeyListener;public class Choose extends JFrame implements ActionListener{JButton ZL_NORMAL;JButton ZL_GOD;JButton ZL_SUPPORT;JLabel ZL_welcome;Choose(int width,int height){ //用窗口的宽和高初始化窗口/*FlowLayout myLayout=new FlowLayout();myLayout.setAlignment(CENTER);*/setLayout(new FlowLayout(FlowLayout.CENTER));this.setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);//this.setBounds(200, 100, width, height);Dimension mydimension=new Dimension(width, 2*height/3); ///便于设置默认大小setSize(width,height);JLabel img=new JLabel(new ImageIcon("pic/backup1.jpg"));img.setBounds(0, 0, this.getWidth(), this.getHeight());this.getLayeredPane().add(img,new Integer(Integer.MIN_VALUE));JPanel jp=(JPanel)this.getContentPane();jp.setOpaque(false);setDefaultCloseOperation(this.EXIT_ON_CLOSE); //默认关闭ZL_welcome=new JLabel(new ImageIcon("pic/welcome.jpg"));ZL_welcome.setPreferredSize(mydimension);add(ZL_welcome);mydimension=new Dimension(width/4, height/6);ZL_NORMAL=new JButton("NORMAL");ZL_GOD=new JButton("GOD");ZL_SUPPORT=new JButton("GET UPDATE");ZL_GOD.setPreferredSize(mydimension);ZL_NORMAL.setPreferredSize(mydimension);ZL_SUPPORT.setPreferredSize(mydimension);setFont(new Font("Helvetica",Font.PLAIN, 4));ZL_NORMAL.addActionListener(this);ZL_SUPPORT.addActionListener(this);ZL_GOD.addActionListener(this);add(ZL_NORMAL);add(ZL_GOD);add(ZL_SUPPORT);ZL_NORMAL.setVisible(true);ZL_GOD.setVisible(true);ZL_SUPPORT.setVisible(true);setVisible(true);setLocationRelativeTo(null);}public void actionPerformed(ActionEvent e){if(e.getSource().equals(ZL_NORMAL)){this.setVisible(false);NormalCal nCal=new NormalCal(500,550,this,1);}if(e.getSource().equals(ZL_SUPPORT)){getUpdate sp=new getUpdate();}if(e.getSource().equals(ZL_GOD)){this.setVisible(false);NormalCal nCal=new NormalCal(500,550,this,0);}}}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。