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

📄 tvcontrol.java

📁 JavaTV Program source code Need to play Windows Media files and streams, mpeg4 video or DVDs in j
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
            public void actionPerformed(java.awt.event.ActionEvent evt)            {                jMenuItemAddActionPerformed(evt);            }        });                jMenuChannel.add(jMenuItemAdd);                jMenuItemMod.setText("Modify channel");        jMenuItemMod.addActionListener(new java.awt.event.ActionListener()        {            public void actionPerformed(java.awt.event.ActionEvent evt)            {                jMenuItemModActionPerformed(evt);            }        });                jMenuChannel.add(jMenuItemMod);                        jMenuChannel.add(jSeparator2);                jMenuItemExit.setText("Exit");        jMenuItemExit.addActionListener(new java.awt.event.ActionListener()        {            public void actionPerformed(java.awt.event.ActionEvent evt)            {                System.exit(0);            }        });                jMenuChannel.add(jMenuItemExit);                jMenuBar1.add(jMenuChannel);                jMenuFaq.setText("Help");        jMenuItemFaq.setText("Faq");        jMenuItemFaq.addActionListener(new java.awt.event.ActionListener()        {            public void actionPerformed(java.awt.event.ActionEvent evt)            {                jMenuItemFaqActionPerformed(evt);            }        });                jMenuFaq.add(jMenuItemFaq);                jMenuItemAbout.setText("About");        jMenuItemAbout.addActionListener(new java.awt.event.ActionListener()        {            public void actionPerformed(java.awt.event.ActionEvent evt)            {                jMenuItemAboutActionPerformed(evt);            }        });                jMenuFaq.add(jMenuItemAbout);                jMenuBar1.add(jMenuFaq);                jPanel1.setLayout(new java.awt.BorderLayout());        jPanel2.setLayout(new java.awt.BorderLayout());                jPanel1.add(jMenuBar1, java.awt.BorderLayout.PAGE_START);        jPanel1.add(jToolBar1, java.awt.BorderLayout.CENTER);        jPanel1.add(jBtnRunPlayer, java.awt.BorderLayout.PAGE_END);                getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_START);                jPanel2.add(jScrollPan, java.awt.BorderLayout.CENTER);                getContentPane().add(jPanel2);                pack();    }        private void jMenuItemExitActionPerformed(java.awt.event.ActionEvent evt)    {        System.out.println("Exit");        System.exit(0);    }        private void jMenuItemAddActionPerformed(java.awt.event.ActionEvent evt)    {        System.out.println("AddToList");        mActions.addch();    }        private void jMenuItemModActionPerformed(java.awt.event.ActionEvent evt)    {        System.out.println("Modify list");        mActions.modch();    }        private void jMenuItemSaveasActionPerformed(java.awt.event.ActionEvent evt)    {        System.out.println("SaveListAs");        mActions.saveList(mChannels);    }        private void jMenuItemSaveActionPerformed(java.awt.event.ActionEvent evt)    {        System.out.println("SaveList");        try        {            mActions.saveList(mChannels, mActions.getChanListPath());        }        catch (Exception e)        {};    }        private void jMenuItemLoadActionPerformed(java.awt.event.ActionEvent evt)    {        System.out.println("LoadList");        javax.swing.JOptionPane.showMessageDialog(this, "To edit your favourite channels, please open\n" +                mActions.getChanListPath() + "\nwith any text editor and add/remove the TV statios.\n" +                "When you've done, close JVTV, please save the text file and run JVTV again");    }        private void jButtonLoadListActionPerformed(java.awt.event.ActionEvent evt)    {        System.out.println("LoadListToList");        javax.swing.JOptionPane.showMessageDialog(this, "To edit your favourite channels, please open\n" +                mActions.getChanListPath() + "\nwith any text editor and add/remove the TV statios.\n" +                "When you've done, close JVTV, please save the text file and run JVTV again");    }        private void jButtonSaveActionPerformed(java.awt.event.ActionEvent evt)    {        System.out.println("SaveList");        try        {            mActions.saveList(mChannels, mActions.getChanListPath());            javax.swing.JOptionPane.showMessageDialog(this, "Saved.");        }        catch (Exception e)        {            javax.swing.JOptionPane.showMessageDialog(this, "save failed!" + e.getMessage(), "Unexpected error", javax.swing.JOptionPane.ERROR_MESSAGE);        }    }        private void jButtonSaveasActionPerformed(java.awt.event.ActionEvent evt)    {        System.out.println("SaveListAs");        try        {            mActions.saveList(mChannels);            javax.swing.JOptionPane.showMessageDialog(this, "Saved.");        }        catch (Exception e)        {            javax.swing.JOptionPane.showMessageDialog(this, "save failed!" + e.getMessage(), "Unexpected error", javax.swing.JOptionPane.ERROR_MESSAGE);        }    }        private void jButtonAddActionPerformed(java.awt.event.ActionEvent evt)    {        System.out.println("AddToList");        mActions.addch();    }        private void jButtonModActionPerformed(java.awt.event.ActionEvent evt)    {        System.out.println("Modify channel");        mActions.modch();    }        private void jButtonRemoveActionPerformed(java.awt.event.ActionEvent evt)    {        System.out.println("RemoveToList");    }        private void jButtonEndplayActionPerformed(java.awt.event.ActionEvent evt)    {        System.out.println("KillMplayer");        mActions.closePlayer();    }        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt)    {        System.out.println("???");        mActions.about();    }        private void jButtonRecActionPerformed(java.awt.event.ActionEvent evt)    {        System.out.println("Record tv");        try        {                        mActions.startRecording(mCurrentChannel);            javax.swing.JOptionPane.showMessageDialog(this, "Recording...");        }        catch (Exception e)        {            javax.swing.JOptionPane.showMessageDialog(this, e.getMessage(), "Unexpected error:", javax.swing.JOptionPane.ERROR_MESSAGE);        }    }        private void jButtonStopRecActionPerformed(java.awt.event.ActionEvent evt)    {        System.out.println("Stop record tv");        try        {            if (mActions.stopRecording() == true)            {                javax.swing.JOptionPane.showMessageDialog(this, "Stopped");            }        }        catch (Exception e)        {            javax.swing.JOptionPane.showMessageDialog(this, e.getMessage(), "Unexpected error:", javax.swing.JOptionPane.ERROR_MESSAGE);        }    }        private void jButtonSetRecActionPerformed(java.awt.event.ActionEvent evt)    {        System.out.println("Recording options");        mActions.showRecordOpt();    }        private void jMenuItemFaqActionPerformed(java.awt.event.ActionEvent evt)    {        mActions.help();    }        private void jMenuItemAboutActionPerformed(java.awt.event.ActionEvent evt)    {        mActions.about();    }        public void jLstCanaliMouseReleased(java.awt.event.MouseEvent evt)    {        // Add your handling code here:        /* future release:         * enter the path for ptune.pl or search it through the filesystem         */        //getPositionM();        TvChannel Chan = (TvChannel) mChannels.get( jLstCanali.getSelectedIndex() );        mActions.switchChannel(Chan);        mCurrentChannel = Chan;//        mActions.info();                jLstCanali.setToolTipText("Id: "+Chan.index+"- Name:"+Chan.name+                "- Program: "+Chan.number+"- frequency: "+Chan.freq+"- Description:"                +Chan.description);            }        private void jBtnRunPlayerActionPerformed(java.awt.event.ActionEvent evt)    {        mActions.runPlayer();    }        private void jLstCanaliValueChanged(javax.swing.event.ListSelectionEvent evt)    {    }        private void exitForm(java.awt.event.WindowEvent evt)    {        System.exit(0);    }/*    public void getPositionM(){//    System.out.println(getAlignmentX()+"frame"+getContentPane().getX()+"lst"+jLstCanali.getX()+"mo"+getMousePosition().x+" "+ getContentPane().getY()+jLstCanali.getY()+getMousePosition().y);//    xx = getContentPane().getLocationOnScreen().getX();//    yy = getContentPane().getLocationOnScreen().getY();//      xx = getMousePosition().x;//      yy = getMousePosition().y;    xy = getLocation();//    getLocation(xy);//    System.out.println("XX YY"+xy );    } */    public static void main(String args[])    {        try        {            javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");        }        catch (Exception e)        { };        new TvControl().setVisible(true);    }        private javax.swing.JButton jBtnRunPlayer;    private javax.swing.JButton jButtonLoadList;    private javax.swing.JButton jButtonSave;    private javax.swing.JButton jButtonSaveas;    private javax.swing.JButton jButtonAdd;    private javax.swing.JButton jButtonMod;    private javax.swing.JButton jButtonRemove;    private javax.swing.JButton jButtonEndplay;    private javax.swing.JButton jButton1;    private javax.swing.JList jLstCanali;    private javax.swing.JMenuBar jMenuBar1;    private javax.swing.JMenu jMenuChannel;    private javax.swing.JMenu jMenuFaq;    private javax.swing.JMenuItem jMenuItemAbout;    private javax.swing.JMenuItem jMenuItemAdd;    private javax.swing.JMenuItem jMenuItemMod;    private javax.swing.JMenuItem jMenuItemExit;    private javax.swing.JMenuItem jMenuItemFaq;    private javax.swing.JMenuItem jMenuItemLoad;    private javax.swing.JMenuItem jMenuItemSave;    private javax.swing.JMenuItem jMenuItemSaveas;    private javax.swing.JSeparator jSeparator1;    private javax.swing.JSeparator jSeparator2;    private javax.swing.JSeparator jSeparator3;    private javax.swing.JSeparator jSeparator4;    private javax.swing.JSeparator jSeparator5;    private javax.swing.JToolBar jToolBar1;    private javax.swing.JPanel jPanel1;    private javax.swing.JPanel jPanel2;    private javax.swing.JScrollPane jScrollPan;    private javax.swing.JSeparator jSeparator6;    private javax.swing.JButton jButtonRec;    private javax.swing.JButton jButtonStopRec;    private javax.swing.JButton jButtonSetRec;    public static int xx;    public static int yy;    public static java.awt.Point xy;        private class MyButton extends javax.swing.JButton    {        public MyButton()        {            this.setPreferredSize(new java.awt.Dimension(28, 28));        }    }}

⌨️ 快捷键说明

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