📄 welcome.java
字号:
import java.awt.*;import java.awt.event.*;import javax.swing.*;public class Welcome extends JFrame implements ActionListener{ JLabel label1, label2; JButton butang1, butang2; public Welcome() { super(":::Bun Venit:::"); Container bekas=getContentPane(); bekas.setLayout(new BorderLayout()); JPanel panelAtas=new JPanel(); panelAtas.setLayout(new FlowLayout()); //Icon logo=new ImageIcon("logo.jpg"); //label1=new JLabel("", logo,SwingConstants.CENTER); //panelAtas.add(label1); bekas.add(panelAtas, BorderLayout.NORTH); JPanel panelTengah=new JPanel(); panelTengah.setLayout(new BorderLayout()); JPanel panelTengahA=new JPanel(); panelTengahA.setLayout(new GridLayout(1,1)); label2=new JLabel("Apasati 'Intra' Pentru A Face Inregistrarea La Curs", SwingConstants.CENTER); label2.setFont(new Font("Arial",Font.ITALIC,15)); label2.setForeground(Color.blue); panelTengahA.add(label2); panelTengah.add(panelTengahA, BorderLayout.CENTER); JPanel panelBawah=new JPanel(); panelBawah.setLayout(new FlowLayout()); butang1=new JButton("INTRA"); butang1.addActionListener(this); butang2=new JButton("EXIT"); butang2.addActionListener(this); panelBawah.add(butang1); panelBawah.add(butang2); panelTengah.add(panelBawah, BorderLayout.SOUTH); bekas.add(panelTengah, BorderLayout.CENTER); setSize(400,300); setLocation(300,250); setVisible(true); } public static void main(String [] args) { Welcome frame=new Welcome(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); } public void actionPerformed(ActionEvent e) { if (e.getSource() == butang1) { CoursesRegistration gerak = new CoursesRegistration(); gerak.setVisible(true); super.show(false); } else if (e.getSource() == butang2) { Exit2 gerak = new Exit2(); gerak.setVisible(true); super.show(false); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -