`
文章列表
写道 AffineTransform类描述了一种二维仿射变换的功能,它是一种二维坐标到二维坐标之间的线性变换,保持二维图形的“平直性”(译注:straightness,即变换后直线还是直线不会打弯,圆弧还是圆弧)和“平行性”(译注:parallelness,其实是指保二维图形间的相对位置关系不变,平行线还是平行线,相交直线的交角不变。大二学过的复变,“保形变换/保角变换”都还记得吧,数学就是王道啊!)。仿射变换可以通过一系列的原子变换的复合来实现,包括:平移(Translation)、缩放(Scale)、翻转(Flip)、旋转(Rotation)和剪切(Shear)。 此类变换可以用一个3×3 ...
package Assis; import javax.swing.JFrame; import javax.swing.JToolBar; import javax.swing.JScrollPane; import javax.swing.JButton; import javax.swing.ImageIcon; import java.awt.Image; import java.awt.Container; import java.awt.BorderLayout; import java.awt.TextArea; import java.awt.event. ...
package Assis; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class DropDownList extends JFrame implements ItemListener { private static final long serialVersionUID = 1L; /** Initializes the applet Resume */ public static void main(String[] args) { final ...
Class.forName(xxx.xx.xx) 返回的是一个类 首先你要明白在java里面任何class都要装载在虚拟机上才能运行。这句话就是装载类用的(和new 不一样,要分清楚)。 至于什么时候用,你可以考虑一下这个问题,给你一个字符串变量,它代表一个类的包名和类名,你怎么实例化它?只有你提到的这个方法了,不过要再加一点。 A a = (A)Class.forName("pacage.A").newInstance(); 这和你 A a = new A(); 是一样的效果。 关于补充的问题 答案是肯定的,jvm会执行静态代码段,你要记住一个概念,静态代码是和class ...
package Assis; import java.awt.AWTException; import java.awt.Image; import java.awt.MenuItem; import java.awt.PopupMenu; import java.awt.SystemTray; import java.awt.TrayIcon; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.MouseEvent; import ...
AWT 和 SWING   AWT 和 SWING 是 Java 设计 GUI 用户界面的基础。与 AWT 的重量级组件不同,Swing 中大部分是轻量级组件。正是这个原因,Swing 几乎无所不能,不但有各式各样先进的组件,而且更为美观易用。所以一开始使用 AWT 的 ...

Swing浅谈(2)(..)

import javax.swing.*; import javax.swing.event.*; public class TestTexts extends JFrame { private JLabel label = new JLabel("Status"); private JTextField textField; private JPasswordField pwdField; private JTextArea textArea; public Test ...
package Assis; import java.io.*; import java.awt.*; import java.awt.event.*; import java.awt.datatransfer.*; import javax.swing.*; public class Note extends JFrame implements ActionListener { private static final long serialVersionUID = 1L; JTextArea textArea = new JTextArea(); JMen ...
package Assis; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class OptionPaneDemo extends JFrame implements ActionListener { private static final long serialVersionUID = 1L; // 创建四个功能按钮 JButton btnMessage = new JButton("显示消息对话框"); JButton btnConfir ...
package Assis; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class MdiApplicationDemo extends JFrame implements ActionListener { private static final long serialVersionUID = 1L; JButton b = new JButton("创建内部窗体 "); JDesktopPane desktopPane = new JDesk ...
package Assis; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class TabbedPaneDemo extends JFrame implements ActionListener { private static final long serialVersionUID = 1L; private ImageIcon m_tabimage; private ImageIcon m_tab1; private ImageIcon m_tab2; ...
package Assis; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class PopupMenuDemo extends JFrame { private static final long serialVersionUID = 1L; public PopupMenuDemo(String strTitle) { // 设置框架窗体标题 super(strTitle); // 创建弹出式菜单 final JPopupMenu ...
package Assis; import java.awt.*; import java.awt.event.*; import javax.swing.*; //swing中默认为边框式 public class ToolBarDemo extends JFrame { private static final long serialVersionUID = 1L; public ToolBarDemo(String strTitle) { // 设置框架窗体标题 super(strTitle); // 创建工具条组件并往上面添加按钮组件 ...
package Assis; import java.awt.Dimension; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.*; public class MenuDemo extends JFrame { private static final long serialVersionUID = 1L; public MenuDemo(String strTitle) { // 设置框架窗体标题 super(s ...
package Assis; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class SimpleListDemo extends JFrame { private static final long serialVersionUID = 1L; public SimpleListDemo() { // 设置框架窗口标题 super("Swing List Demo"); String[] data = { "Ite ...
Global site tag (gtag.js) - Google Analytics