⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mainframe.java

📁 很经典的银行ATM操作系统。 可以创建账户
💻 JAVA
字号:
import java.sql.*;
import java.awt.*;
import java.applet.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;

class WinMain extends Frame implements ActionListener
{
	Button b1,b2,b3;
	WinMain()
	{
		Panel p=new Panel();
		b1=new Button("用户");
		b2=new Button("工作人员");
		b3=new Button("开户");
		b1.addActionListener(this);
		b2.addActionListener(this);
		b3.addActionListener(this);
		Box boxV;
		boxV=Box.createVerticalBox();
		boxV.add(new Label("欢迎使用银行系统!"));
		boxV.add(new Label("您是:"));
		Box boxH1,boxH2,boxH3;
		boxH1=Box.createHorizontalBox();
		boxH2=Box.createHorizontalBox();
		boxH3=Box.createHorizontalBox();
		boxH1.add(Box.createHorizontalStrut(100));
		boxH1.add(b1);
		boxH1.add(Box.createHorizontalStrut(100));
		boxH2.add(Box.createHorizontalStrut(100));
		boxH2.add(b2);
		boxH2.add(Box.createHorizontalStrut(100));
		boxH3.add(Box.createHorizontalStrut(100));
		boxH3.add(b3);
		boxH3.add(Box.createHorizontalStrut(100));
		boxV.add(boxH1);
		boxV.add(Box.createVerticalStrut(8));
		boxV.add(boxH2);
		boxV.add(Box.createVerticalStrut(8));
		boxV.add(boxH3);
		p.add(boxV);
		add(p);
	}
	public void actionPerformed(ActionEvent e)
	{
		String s[]={"调用"};
		if(e.getSource()==b1)
		{
			UserFrame.main(s);
		}
		if(e.getSource()==b2)
		{
			WorkerFrame.main(s);
		}
		if(e.getSource()==b3)
		{
			OpenFrame.main(s);
		}
	}
}

public  class MainFrame
{
	public static void main(String args[])
	{
		WinMain window=new WinMain();
		window.setBounds(100,100,300,300);
		window.setVisible(true);
		window.addWindowListener(new WindowAdapter()
		{
			public void windowClosing(WindowEvent e)
			{
				System.exit(0);
			}
		});
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -