startbean.java~3~

来自「flowGUI简单的java图形设计」· JAVA~3~ 代码 · 共 44 行

JAVA~3~
44
字号
package com.wiziflow.gui;import javax.swing.*;import java.awt.event.*;import java.awt.*;/** * 开始图标。定义“开始”中的所有属性 */public class StartBean extends Bean {  ImageIcon icon = new ImageIcon(com.wiziflow.gui.StartBean.class.getResource("images/start.gif"));  JDialog dialog = new JDialog(Frame.getFrames()[0],"属性设置",true);  public StartBean() {    this.setText("开始");    this.setIcon(icon);    JTabbedPane tabPane=new JTabbedPane();    //tabPane.setSize(400,400);    JLabel label1=new JLabel("jlabel1");    tabPane.add("常规",label1);    dialog.getContentPane().add(tabPane);  }  /**   *  Bean类监听双击事件,子类覆盖showPropertyDialog()弹出属性对话框   */  public void showPropertyDialog(){    //System.out.println("startBean showPropertyDialog()");    //dialog.getContentPane().add(new JButton("阿里送到家发"));    //dialog.setSize(200,200);    dialog.pack();    dialog.setLocationRelativeTo(this);    dialog.show();//    JOptionPane option = new JOptionPane();//    option.removeAll();//    dialog=option.createDialog(this,"呵呵!");//    dialog.getContentPane().add(new JButton("哈哈"));//    dialog.show();  }  public JTabbedPane createTabbedPane() {    JPanel panel = new JPanel();    return null;  }}

⌨️ 快捷键说明

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