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

📄 facestyledialog.java

📁 好的超市源码供大家下载
💻 JAVA
字号:
package view.dialog;

import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JRadioButton;

import view.com.CenterDialog;
import view.com.getcomponent.button.GetButton;
import action.implementclass.dialogaction.FaceStyleDialogActionImp;

/**
 * 设定皮肤对话框
 * @author linfeng
 *
 */
public class FaceStyleDialog extends JDialog {
  
  /**
   * styleDialog 皮肤对话框
   * bg 按钮组
   * standard 标准风格单选按钮
   * antiquity 古典风格单选按钮
   * modern 现在风格单选按钮
   * ok 确定按钮
   * cancel 取消按钮
   * topPanel 上面板
   * bottomPanel 下面板
   * bl 边界布局
   */
  public static JDialog styleDialog;
  private ButtonGroup bg;
  public static JRadioButton standard, antiquity, modern;
  private JButton ok, cancel;
  private JPanel topPanel, bottomPanel;
  private BorderLayout bl;

  public FaceStyleDialog() {
    styleDialog = new JDialog();
    styleDialog.setTitle("风格设置");
    styleDialog.setSize(300, 200);
    new CenterDialog().getCenterDialog(styleDialog, true);    
    getTopPanel();
    getBottomPanel();
    bl = new BorderLayout();
    styleDialog.add(new JLabel("请选择界面风格:"), bl.NORTH);
    styleDialog.add(topPanel, bl.CENTER);
    styleDialog.add(bottomPanel, bl.SOUTH);
    styleDialog.setVisible(true);
  }

  /**
   * 获得上面板
   */
  public void getTopPanel() {
    topPanel = new JPanel();
    bg = new ButtonGroup();
    standard = new JRadioButton("标准(默认)", true);
    antiquity = new JRadioButton("经典", false);
    modern = new JRadioButton("现代", false);
    topPanel.setLayout(new FlowLayout());
    bg.add(standard);
    bg.add(antiquity);
    bg.add(modern);
    topPanel.add(standard);
    topPanel.add(antiquity);
    topPanel.add(modern);
  }

  /**
   * 获得下面板
   */
  public void getBottomPanel() {
    bottomPanel = new JPanel();
    ok = new GetButton().getButton("确定", "icon/button/确定.GIF", "确定");
    cancel = new GetButton().getButton("取消","icon\\button\\取消.GIF","取消");
    bottomPanel.setLayout(new FlowLayout());
    bottomPanel.add(ok);
    bottomPanel.add(cancel);
    //加事件
    ok.addActionListener(new FaceStyleDialogActionImp());
    cancel.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        styleDialog.setVisible(false);
        styleDialog.dispose();
      }
    });
  }
}

⌨️ 快捷键说明

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