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

📄 jloadingview.java

📁 java版本的实现mp3搜索的完整程序。
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
/* * JLoadingView.java */package jloading;import biz.tbuy.huliqing.jloading.TaskManager;import biz.tbuy.huliqing.jloading.TaskModel;import biz.tbuy.huliqing.jloading.TaskTableModel;import biz.tbuy.huliqing.jloading.ext.ExtensionFactory;import biz.tbuy.huliqing.jloading.ext.mp3.MusicExt;import biz.tbuy.huliqing.jloading.mycell.ColumnCellRenderer;import biz.tbuy.huliqing.jloading.mycell.ProgressBarRenderer;import java.awt.Color;import org.jdesktop.application.Action;import org.jdesktop.application.ResourceMap;import org.jdesktop.application.SingleFrameApplication;import org.jdesktop.application.FrameView;import org.jdesktop.application.TaskMonitor;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.io.File;import java.util.ArrayList;import javax.swing.Icon;import javax.swing.JDialog;import javax.swing.JFrame;import javax.swing.SwingUtilities;import javax.swing.Timer;import javax.swing.table.TableColumn;import javax.swing.table.TableColumnModel;/** * The application's main frame. */public class JLoadingView extends FrameView {    public JLoadingView(SingleFrameApplication app) {        super(app);        initComponents();        myInitComponents();// 自定义初始化        /*        // status bar initialization - message timeout, idle icon and busy animation, etc        ResourceMap resourceMap = getResourceMap();        int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");        messageTimer = new Timer(messageTimeout, new ActionListener() {            public void actionPerformed(ActionEvent e) {                statusMessageLabel.setText("");            }        });        messageTimer.setRepeats(false);        int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");        for (int i = 0; i < busyIcons.length; i++) {            busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");        }        busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {            public void actionPerformed(ActionEvent e) {                busyIconIndex = (busyIconIndex + 1) % busyIcons.length;                statusAnimationLabel.setIcon(busyIcons[busyIconIndex]);            }        });        idleIcon = resourceMap.getIcon("StatusBar.idleIcon");        statusAnimationLabel.setIcon(idleIcon);        progressBar.setVisible(false);        // connecting action tasks to status bar via TaskMonitor        TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());        taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {            public void propertyChange(java.beans.PropertyChangeEvent evt) {                String propertyName = evt.getPropertyName();                if ("started".equals(propertyName)) {                    if (!busyIconTimer.isRunning()) {                        statusAnimationLabel.setIcon(busyIcons[0]);                        busyIconIndex = 0;                        busyIconTimer.start();                    }                    progressBar.setVisible(true);                    progressBar.setIndeterminate(true);                } else if ("done".equals(propertyName)) {                    busyIconTimer.stop();                    statusAnimationLabel.setIcon(idleIcon);                    progressBar.setVisible(false);                    progressBar.setValue(0);                } else if ("message".equals(propertyName)) {                    String text = (String)(evt.getNewValue());                    statusMessageLabel.setText((text == null) ? "" : text);                    messageTimer.restart();                } else if ("progress".equals(propertyName)) {                    int value = (Integer)(evt.getNewValue());                    progressBar.setVisible(true);                    progressBar.setIndeterminate(false);                    progressBar.setValue(value);                }            }        });         */    }    @Action    public void showAboutBox() {        //if (aboutBox == null) {            //JFrame mainFrame = JLoadingApp.getApplication().getMainFrame();            //aboutBox = new JLoadingAboutBox(mainFrame);            //aboutBox.setLocationRelativeTo(mainFrame);        //}        //JLoadingApp.getApplication().show(aboutBox);    }        /** 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() {        mainPanel = new javax.swing.JPanel();        jTabbedPane1 = new javax.swing.JTabbedPane();        jSplitPane1 = new javax.swing.JSplitPane();        jPanel1 = new javax.swing.JPanel();        jScrollPane1 = new javax.swing.JScrollPane();        jTable1 = new javax.swing.JTable();        jButton1 = new javax.swing.JButton();        jButton2 = new javax.swing.JButton();        jButton3 = new javax.swing.JButton();        jButton4 = new javax.swing.JButton();        jButton5 = new javax.swing.JButton();        jTabbedPane2 = new javax.swing.JTabbedPane();        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(jloading.JLoadingApp.class).getContext().getResourceMap(JLoadingView.class);        mainPanel.setBackground(resourceMap.getColor("mainPanel.background")); // NOI18N        mainPanel.setName("mainPanel"); // NOI18N        jTabbedPane1.setBackground(resourceMap.getColor("jTabbedPane1.background")); // NOI18N        jTabbedPane1.setTabLayoutPolicy(javax.swing.JTabbedPane.SCROLL_TAB_LAYOUT);        jTabbedPane1.setTabPlacement(javax.swing.JTabbedPane.RIGHT);        jTabbedPane1.setFocusable(false);        jTabbedPane1.setName("jTabbedPane1"); // NOI18N        jSplitPane1.setBackground(resourceMap.getColor("jSplitPane1.background")); // NOI18N        jSplitPane1.setBorder(null);        jSplitPane1.setDividerLocation(160);        jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);        jSplitPane1.setResizeWeight(0.5);        jSplitPane1.setName("jSplitPane1"); // NOI18N        jPanel1.setBackground(resourceMap.getColor("jPanel1.background")); // NOI18N        jPanel1.setName("jPanel1"); // NOI18N        jScrollPane1.setName("jScrollPane1"); // NOI18N        jTable1.setModel(            new TaskTableModel()        );        jTable1.setGridColor(resourceMap.getColor("jTable1.gridColor")); // NOI18N        jTable1.setIntercellSpacing(new java.awt.Dimension(0, 0));        jTable1.setName("jTable1"); // NOI18N        jTable1.setSelectionBackground(resourceMap.getColor("jTable1.selectionBackground")); // NOI18N        jTable1.setSelectionForeground(resourceMap.getColor("jTable1.selectionForeground")); // NOI18N        jTable1.setShowHorizontalLines(false);        jTable1.setShowVerticalLines(false);        jScrollPane1.setViewportView(jTable1);        jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N        jButton1.setName("jButton1"); // NOI18N        jButton1.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton1ActionPerformed(evt);            }        });        jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N        jButton2.setName("jButton2"); // NOI18N        jButton2.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton2ActionPerformed(evt);            }        });        jButton3.setText(resourceMap.getString("jButton3.text")); // NOI18N        jButton3.setToolTipText(resourceMap.getString("jButton3.toolTipText")); // NOI18N        jButton3.setName("jButton3"); // NOI18N        jButton3.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {                jButton3ActionPerformed(evt);            }        });        jButton4.setText(resourceMap.getString("jButton4.text")); // NOI18N        jButton4.setName("jButton4"); // NOI18N        jButton4.addActionListener(new java.awt.event.ActionListener() {            public void actionPerformed(java.awt.event.ActionEvent evt) {

⌨️ 快捷键说明

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