learning java AWT 画图】的更多相关文章

import javax.swing.*; import java.awt.*; import java.util.Random; public class SimpleDraw { private final String RECT_SHAPE = "rect"; private final String OVAL_SHAPE = "oval"; private Frame f = new Frame("Test"); private JBut…
1. AWT画图  Graphics类  提供绘制简单图形的方法 更新图片时用到 repaint , update , 程序不应该主动调用paint和update, 这两个方法都应该是由AWT系统负责调用,用户重写paint 即可. 示例: public class Main { private final String RECT_SHAPE = "rect"; private final String OVAL_SHAPE = "oval"; private Fr…
import javax.swing.*; import java.awt.*; import java.awt.datatransfer.Clipboard; import java.awt.datatransfer.DataFlavor; import java.awt.datatransfer.StringSelection; import java.awt.datatransfer.UnsupportedFlavorException; import java.io.IOExceptio…
import java.awt.*;port java.awt.event.ActionListener; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionAdapter; import java.awt.image.BufferedImage; public class HandDraw { ; ; ; ; PopupMenu pop =…
import java.awt.*; import java.awt.event.*; public class SimpleMenu { private Frame f = new Frame("test"); private MenuBar mb = new MenuBar(); Menu file = new Menu("file"); Menu edit = new Menu("edit"); PopupMenu pop = new Po…
import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; public class SimpleMenu { private Frame f = new Frame("test"); private MenuBar mb =…
import java.awt.*; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.WindowEvent; import java.awt.event.WindowListener; public class WindowListenerTest { private Frame f = new Frame(); ,); private Button bt…
import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class EventQs { private Frame f = new Frame("event test"); private Button ok = new Button("confired"); ); public v…
import java.awt.*; public class DialogTest { Frame f = new Frame("test"); Dialog d1 = new Dialog(f, "model dialog", true); Dialog d2 = new Dialog(f, "non-model dialog", false); Button b1 = new Button("open model dialog&q…
import javax.swing.*; import java.awt.*; public class CommonComponent { Frame f = new Frame("test"); Button ok = new Button("confirmed"); CheckboxGroup cbg = new CheckboxGroup(); Checkbox male = new Checkbox("man", cbg, true)…