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

📄 main.java

📁 java绘图 java awt 经典绘图的例子,对于初学awt模块的人非常有帮助.
💻 JAVA
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package arrow;import java.awt.Button;import java.awt.FlowLayout;import java.awt.Frame;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.awt.event.MouseEvent;import java.awt.event.MouseListener;/** * * @author zhaolin */public class Main {      public static void main(String[] args) {            Frame f = new Frame();            f.setLayout(new FlowLayout());            final Button b1 = new Button("OK");            final Button b2 = new Button("EXIT");            ActionListener al = new ActionListener(){            public void actionPerformed(ActionEvent e) {                Object obj = e.getSource();                Button b = (Button)obj;                if(b == b1){                    System.out.println("OK clicked");                }else if(b == b2){                    System.out.println("EXIT clicked");                }                            }                            };            b1.addActionListener(al);            b2.addActionListener(al);            f.add(b1);            f.add(b2);            f.setSize(300, 260);            f.setVisible(true);               }}

⌨️ 快捷键说明

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