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

📄 jxerrordialogdemopanel.java

📁 java实现浏览器等本地桌面的功能
💻 JAVA
字号:
/* * JXGlassBoxDemoPanel.java * * Created on April 18, 2005, 4:20 PM */package org.jdesktop.demo.swingx;import javax.swing.JLabel;import org.jdesktop.demo.DemoPanel;import org.jdesktop.swingx.JXErrorDialog;/** * Demonstrates the JXGlassBox component. * * @author  rbair */public class JXErrorDialogDemoPanel extends DemoPanel {        /** Creates new form JXGlassBoxDemoPanel */    public JXErrorDialogDemoPanel() {        setName("JXErrorDialog Demo");        initComponents();    }    public String getHtmlDescription() {        return "<html>Click on the error button to generate an Exception. The" +                "exception will then be displayed in a JXErrorDialog</html>";    }    public String getName() {        return "Error Dialog";    }    /** This method is called from within the constructor to     * initialize the form.     * WARNING: Do NOT modify this code. The content of this method is     * always regenerated by the Form Editor.     */    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents    private void initComponents() {        java.awt.GridBagConstraints gridBagConstraints;        jXGlassBox1 = new org.jdesktop.swingx.JXGlassBox();        jLabel1 = new javax.swing.JLabel();        generateErrorBtn = new javax.swing.JButton();        jXGlassBox1.setLayout(new java.awt.BorderLayout());        JLabel lbl = new JLabel("<html><i>Please click to dismiss...</i></html>");        jXGlassBox1.add(lbl);        jLabel1.setBackground(new java.awt.Color(255, 255, 255));        jLabel1.setText("<html><c><i>Click to hide this panel (ie, dismiss)</c></i></html>");        jLabel1.setOpaque(true);        jXGlassBox1.add(jLabel1, java.awt.BorderLayout.CENTER);        setLayout(new java.awt.GridBagLayout());        generateErrorBtn.setText("Generate Error");        generateErrorBtn.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                generateErrorBtnActionPerformed(evt);            }        });        gridBagConstraints = new java.awt.GridBagConstraints();        gridBagConstraints.gridx = 0;        gridBagConstraints.gridy = 0;        gridBagConstraints.weightx = 1.0;        gridBagConstraints.weighty = 1.0;        gridBagConstraints.insets = new java.awt.Insets(12, 12, 11, 11);        add(generateErrorBtn, gridBagConstraints);    }    // </editor-fold>//GEN-END:initComponents    private void generateErrorBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_generateErrorBtnActionPerformed        try {            throw new Exception("This is a test exception.");        } catch (Exception e) {            JXErrorDialog.showDialog(null, "Application Error", e);        }    }//GEN-LAST:event_generateErrorBtnActionPerformed            // Variables declaration - do not modify//GEN-BEGIN:variables    private javax.swing.JButton generateErrorBtn;    private javax.swing.JLabel jLabel1;    private org.jdesktop.swingx.JXGlassBox jXGlassBox1;    // End of variables declaration//GEN-END:variables    }

⌨️ 快捷键说明

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