Can't appear buttons. help!!!

hellow, i'm pretty new 'bout JMF & so stupid with it xD
i've a project to make a media player with JMF, i using netbeans IDE 5.5
here's th list:
====================================================
import java.io.File;
import java.io.IOException;
import java.awt.Component;
import java.awt.*;
import java.net.URL;
import java.net.MalformedURLException;
import javax.media.*;
import javax.sound.sampled.*;
public class kanonplayer extends javax.swing.JFrame {
/** Creates new form kanonplayer */
public kanonplayer() {
initComponents();
public void btnOpen() {
javax.swing.JFileChooser jFileChooser = new javax.swing.JFileChooser();
int buka = jFileChooser.showOpenDialog(null);
if (buka == jFileChooser.APPROVE_OPTION) {
java.net.URL fileURL = null;
try {
fileURL = jFileChooser.getSelectedFile().toURL();
catch (java.net.MalformedURLException mfue) {
System.err.println("Terjadi Exception berupa: MalformedURLException!");
if (fileURL != null)
MediaPanel mediaPanel = new MediaPanel(fileURL);
this.getContentPane().add(mediaPanel);
this.setSize(200, 200);
this.setVisible(true);
this.setResizable(true);
class MediaPanel extends javax.swing.JPanel {
public MediaPanel(java.net.URL mediaURL) {
setLayout(new BorderLayout());
javax.media.Manager.setHint(javax.media.Manager.LIGHTWEIGHT_RENDERER, this);
try {
javax.media.Player mediaPlayer = javax.media.Manager.createRealizedPlayer(mediaURL);
java.awt.Component video = mediaPlayer.getVisualComponent();
java.awt.Component controls = mediaPlayer.getControlPanelComponent();
if ( video != null )
add( mediaPlayer.getVisualComponent(), BorderLayout.CENTER );
if ( controls != null )
add( mediaPlayer.getControlPanelComponent(), BorderLayout.SOUTH );
mediaPlayer.start();
catch ( javax.media.NoPlayerException noPlayerException )
System.err.println( "Terjadi Exception: NoPlayerException" );
catch ( javax.media.CannotRealizeException cannotRealizeException ) {
System.err.println( "Terjadi Exception: CannotRealizeException" );
catch ( java.io.IOException iOException ) {
System.err.println( "Terjadi Exception: iOException" );
public class JavaSoundDetector {
boolean supported = false;
public JavaSoundDetector() {
     try {
     DataLine.Info info = new DataLine.Info(TargetDataLine.class,
                              null,
                              AudioSystem.NOT_SPECIFIED);
     supported = AudioSystem.isLineSupported(info);
     } catch (Exception ex) {
     supported = false;
public boolean isSupported() {
     return supported;
/** 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 ">
private void initComponents() {
jButton1 = new javax.swing.JButton();
jToolBar1 = new javax.swing.JToolBar();
jPanel1 = new javax.swing.JPanel();
jMenuBar1 = new javax.swing.JMenuBar();
jMenu1 = new javax.swing.JMenu();
jMenuItem1 = new javax.swing.JMenuItem();
jSeparator1 = new javax.swing.JSeparator();
jMenuItem2 = new javax.swing.JMenuItem();
jButton1.setText("btnOpen");
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("kanonplayer");
setCursor(new java.awt.Cursor(java.awt.Cursor.CROSSHAIR_CURSOR));
jPanel1.setLayout(new java.awt.BorderLayout());
jMenu1.setText("File");
jMenu1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenu1ActionPerformed(evt);
jMenuItem1.setMnemonic('O');
jMenuItem1.setText("Open");
jMenuItem1.setAutoscrolls(true);
jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem1ActionPerformed(evt);
jMenu1.add(jMenuItem1);
jMenu1.add(jSeparator1);
jMenuItem2.setMnemonic('E');
jMenuItem2.setText("Exit");
jMenuItem2.setAutoscrolls(true);
jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem2ActionPerformed(evt);
jMenu1.add(jMenuItem2);
jMenuBar1.add(jMenu1);
setJMenuBar(jMenuBar1);
org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jToolBar1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE)
.add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE)
layout.setVerticalGroup(
layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(layout.createSequentialGroup()
.add(jToolBar1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 25, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
.addContainerGap(117, Short.MAX_VALUE))
.add(jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE)
pack();
}// </editor-fold>
private void jMenu1ActionPerformed(java.awt.event.ActionEvent evt) {                                      
// TODO add your handling code here:
private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {                                          
// TODO add your handling code here:
btnOpen();
private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {                                          
// TODO add your handling code here:
System.exit (1);
* @param args the command line arguments
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new kanonplayer().setVisible(true);
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem jMenuItem1;
private javax.swing.JMenuItem jMenuItem2;
private javax.swing.JPanel jPanel1;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JToolBar jToolBar1;
// End of variables declaration
====================================================
my problems are can't compile "javac" to command prompt.
-i run my project to netbeans is appears & i can hear the sounds of the music mp3.. but start, pause, & volume buttons don't appear.
<center><img src="
http://farm2.static.flickr.com/1144/1389752653_4b0d436eef_o.jpg"/></center>
can you tell me why? & do i've to adding some source code? so what the source code is? pliz.
-how to could appear a video? ^^
THANX before, i hope you understand what i say =]
-okiedokie-

I don't have JMF or netbeans so commented out things that need them. The gui works now.
import java.io.File;
import java.io.IOException;
import java.awt.Component;
import java.awt.*;
import java.net.URL;
import java.net.MalformedURLException;
import javax.swing.*;
//import javax.media.*;
import javax.sound.sampled.*;
//import org.jdesktop.layout.GroupLayout;
public class KP extends JFrame {
    MediaPanel mediaPanel;
    public KP() {
        initComponents();
        mediaPanel = new MediaPanel();
        this.getContentPane().add(mediaPanel);
        this.setSize(200, 200);
        this.setVisible(true);
        //this.setResizable(true);
    public void btnOpen() {
        JFileChooser jFileChooser = new JFileChooser();
        int buka = jFileChooser.showOpenDialog(null);
        if (buka == jFileChooser.APPROVE_OPTION) {
            URL fileURL = null;
            try {
                fileURL = jFileChooser.getSelectedFile().toURL();
            } catch (MalformedURLException mfue) {
                System.err.println("Terjadi Exception berupa: MalformedURLException!");
            if (fileURL != null) {
                mediaPanel.setURL(fileURL);
    class MediaPanel extends JPanel {
        public MediaPanel() {
            setLayout(new BorderLayout());
//            Manager.setHint(Manager.LIGHTWEIGHT_RENDERER, this);
        public void setURL(URL mediaURL) {
            try {
                Player mediaPlayer = Manager.createRealizedPlayer(mediaURL);
                Component video = mediaPlayer.getVisualComponent();
                Component controls = mediaPlayer.getControlPanelComponent();
                if ( video != null )
                    add( mediaPlayer.getVisualComponent(), BorderLayout.CENTER );
                if ( controls != null )
                    add( mediaPlayer.getControlPanelComponent(), BorderLayout.SOUTH );
                mediaPlayer.start();
            } catch ( NoPlayerException noPlayerException ) {
                System.err.println( "Terjadi Exception: NoPlayerException" );
            } catch ( CannotRealizeException cannotRealizeException ) {
                System.err.println( "Terjadi Exception: CannotRealizeException" );
            } catch ( IOException iOException ) {
                System.err.println( "Terjadi Exception: iOException" );
    public class JavaSoundDetector {
        boolean supported = false;
        public JavaSoundDetector() {
            try {
                DataLine.Info info = new DataLine.Info(TargetDataLine.class,null,
                                                       AudioSystem.NOT_SPECIFIED);
                supported = AudioSystem.isLineSupported(info);
            } catch (Exception ex) {
                supported = false;
        public boolean isSupported() { return supported; }
    private void initComponents() {
        // ToolBar
        jButton1 = new javax.swing.JButton();
        jButton1.setText("btnOpen");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
        jToolBar1 = new javax.swing.JToolBar();
        jToolBar1.add(jButton1);
        // MenuBar
        jPanel1 = new javax.swing.JPanel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JSeparator();
        jMenuItem2 = new javax.swing.JMenuItem();
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("kanonplayer");
        setCursor(new java.awt.Cursor(java.awt.Cursor.CROSSHAIR_CURSOR));
//        jPanel1.setLayout(new java.awt.BorderLayout());
        jMenu1.setText("File");
        jMenu1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenu1ActionPerformed(evt);
        jMenuItem1.setMnemonic('O');
        jMenuItem1.setText("Open");
        jMenuItem1.setAutoscrolls(true);
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem1ActionPerformed(evt);
        jMenu1.add(jMenuItem1);
        jMenu1.add(jSeparator1);
        jMenuItem2.setMnemonic('E');
        jMenuItem2.setText("Exit");
        jMenuItem2.setAutoscrolls(true);
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMenuItem2ActionPerformed(evt);
        jMenu1.add(jMenuItem2);
        jMenuBar1.add(jMenu1);
        setJMenuBar(jMenuBar1);
        getContentPane().add(jToolBar1, BorderLayout.NORTH);
        GroupLayout layout = new GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.LEADING)
              .add(jToolBar1, GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE)
              .add(jPanel1, GroupLayout.DEFAULT_SIZE, 179, Short.MAX_VALUE)
        layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.LEADING)
              .add(layout.createSequentialGroup()
              .add(jToolBar1, GroupLayout.PREFERRED_SIZE, 25, GroupLayout.PREFERRED_SIZE)
              .addContainerGap(117, Short.MAX_VALUE))
              .add(jPanel1, GroupLayout.DEFAULT_SIZE, 142, Short.MAX_VALUE)
        pack();
    private void jMenu1ActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        btnOpen();
    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        System.exit (1);
    public static void main(String args[]) {
        EventQueue.invokeLater(new Runnable() {
            public void run() {
                new KP().setVisible(true);
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JToolBar jToolBar1;
    // End of variables declaration
}

Similar Messages

  • My IPhone shut off by itself and I can't turn it back on. My lock screen button is broken and I tried plugging it into the wall but nothing happened. Can you guys please help me.

    My IPhone shut off by itself and I can't turn it back on. My lock screen button is broken and I tried plugging it into the wall but nothing happened. Can you guys please help me.

    IIf the battery was completely drained it might take some time before the phone will respond. Wait at least 30 minutes with the phone connected to the charger. Then reset your device. Press and hold the Home and Sleep buttons simultaneously until the Apple logo appears. Let go of the buttons and let the device restart. If the phone starts up let it continue to charge until it's 100%.
    if the broken button will not let you do the reset Make an appointment at an Apple Store to have your device examined by a technician. Or contact Apple Support.

  • How can I add popup help messages when I mouse over a button

    Hi there,
    I haev Acrobat x 10 pro.
    I'm new to acrobat and would like to set up a friendly form for people to fill in online.  I'd like them to have some interactive help so that for example when they mouse over or click a button, some help text appears.  I've played around with adding a text field that is hidden and then adding action items to a button to show it.  This works, but my text field is shaded like a normal text field and I'd like it to look different.
    Is there a better way to to this popup effect or is there a way t omake the popup look like a popup and not a text field?
    All help gratefully received,
    Thanks in advance.

    I'mnot sure what you mean by shading exactly, but you can set up a text field so that it doesn't have an inset border. An alternative is to use a button to display the text. Buttons are more flexible since you can set a button icon to be anything that can appear on a PDF page (text, images, vector graphics). For a sample, see: https://acrobat.com/#d=aP-2xL45pM57xVkT6d6fSg
    Also, if you use a text field, set it's default value to the text you want to display so that the field won't get blanked if the form is reset. You don't have to worry about this when using buttons.

  • My screen continually freezes up.  I've tried closing all apps that are openfreezby double clicking on the home button and closing them. I have held down on the home button and start button simultaneously and it still freezes. Can someone out the help me?

    MY screen continually freezes up. I've tried closing all apps that are open and have held down the home button and start button simultaneously but neither helped. Can someone out there help me?

    Well the next couple of things to try would be to reset all settings, and if that doesn't help, it's probably time to restore the iOS software.
    Settings>General>Reset>Reset all settings. That will take all settings on the iPad back to factory defaults. It will not delete anything and you will not lose any data, but you will have to enter all settings again ...WiFi passwords, enable Siri, select your wallpaper, adjust brightness, turn on location services and set privacy settings, etc, etc.
    You can read about restoring the software here.
    iTunes: Restoring iOS software - Support - Apple
    Should you decide to restore the iOS, it is extremely important that you back up first so that you can restore from the backup and then sync with iTunes afterward in order to restore all content back to the iPad. It is all covered in the kb article.
    If you do not sync with iTunes, then I assume that you backup with iCloud. In that case you can erase the device in Settings>General>Reset>Erase all content and settings. Once again, backing up with I loud is I,operative before you do this so that you can restore from the iCloud backup after you erase the iPad and start over again with activation.
    You should read this first before you restore from either backup.
    How to backup and restore from a backup
    http://support.apple.com/kb/HT1766
    This is a must read before you erase the iPad should you decide to go that route.
    iOS: Understanding 'Erase All Content and Settings' - Support - Apple

  • Help!! ALL of a sudden I cannot open ANY of my pictures in iPhoto. I have clicked the iPhoto icon on my dock, as I always have done, but no pictures appear. Can anybody out there help me???? Thank you!

    Help!! ALL of a sudden I cannot open ANY of my pictures in iPhoto. I have clicked the iPhoto icon on my dock, as I always have done, but no pictures appear. Can anybody out there help me???? Thank you!

    What does appear?

  • HT201263 my ipod touch 4th gen isnt work after a long time with 0 percent battery power.Then its not working. computer doesnt respond to my ipod .only black screen is appearing it even not wake up after reset it what can i do please help me

    my ipod touch 4th gen isnt work after a long time with 0 percent battery power.Then its not working. computer doesnt respond to my ipod .only black screen is appearing it even not wake up after reset it what can i do please help me

    After being connected to a charging source overnight try:
    - iOS: Not responding or does not turn on
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try on another computer
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
      Apple Retail Store - Genius Bar

  • IPhone 5 has ran out now it won't charge ? I can't reset because my power button is broke ? What can I do, please help

    iPhone 5 has ran out now it won't charge ? I can't reset because my power button is broke ? What can I do, please help will my one year warranty cover this ?

    Try cleaning the dock connector.  Try a new cable or charger.
    If no luck, it should be covered under warranty.

  • How Can I hide search help button in alv ?

    Hi Sdn .
    I want to hide search help button in my alv ..
    My  gs_fcat-f4availabl  = 'X'. is not active ..  but  there is search help button  .
    How Can I hide button .
    Regards  .
    Serkann

    donnot pass any values in field catalog for reference field and reference table.
    or dont use any standard data element

  • Hi, i am from UAE. I buy iphone 4 yesterday but i cant able to activate. when i insert iphoone to itunes informing sim inserted but not appears to be supported. what can i do pplz help...........

    Hi, i am from UAE. I buy iphone 4 yesterday but i cant able to activate. when i insert iphoone to itunes informing sim inserted but not appears to be supported. what can i do pplz help...........

    From where did you buy the iphone?
    What country?
    What store?
    An Apple store? Official Apple reseller?
    Why do you think it is unlocked?

  • New mail button does not respond so can't write mail. help please?

    New mail button does not respond so can't write mail. help please?

    I am no expert, but open your mail, go to the top of your apple bar click the apple sign then force quit mail, restart and it may work.
    I had this issue before and it was resolved.

  • Need help with Flash CS4 buttons/can't get buttons to control anything

    Hello,
    I need help with Flash CS4. I am making a banner with an animation (Image change into movie clip "3D Spiral") and added buttons but I cannot get the buttons to control the animation. Please help I am frustrated! If someone could help I would be most appreciated.

    Thank you.
    Regards,
    Michael J. Sheehan  allelois
    Date: Mon, 17 Aug 2009 18:48:09 -0600
    From: [email protected]
    To: [email protected]
    Subject: Need help with Flash CS4 buttons/can't get buttons to control anything
    Hi there
    I'm not sure how you wound up where you did. But you wound up in the Adobe Captivate forums. Please stand by as I move your thread to the Flash forums.
    Cheers... Rick
    >

  • What can i do when the error -42110 appears? help!!

    what can i do when the error -42110 appears? help!!
    i've just updated my itunes and then this error's appeared!

    I had the same problem, another community member told me that i had find the 'SC info' folder and i had to delete it. The folder was hidden so i couldn't find it. So if you can't find it go to Folders and Search Options and click on the View tab and under Advanced setting under  "Hidden Files and Folders" check the 'Show hidden files, folders and drives' option.
    Then type the following location on your address bar:
    C:\ProgramData\Apple Computer\iTunes
    Then delete the SC info folder and restart your computer.
    This solved my problem.
    Hope this solves yours.

  • I have an application in my Firefox Options which I can't remove any help would be great

    I have a download torrent called Bitlord which I have removed through my control panel - but it appears it is still there in my Options Applications which I can't removed - any help would be great

    Hello liz1411, check also if you have something related to Bitlord (like toolbars) in Firefox Extensions and delete it, go from Firefox button(the orange button at the right top) > Add-ons > Extensions.
    thank you

  • When syncing my iPhone with iTunes, I get the error, "some items did not sync, see itunes for help", but can't find any helps for this in iTunes. Where can I find out what is not syncing?

    When syncing my iPhone with my iPhone, I get a message that 2 items did not sync - use iTunes for help.
    But I can't find any help information in iTunes at all, let alone when items are not syncing.
    How do I figure out what is not syncing?

    Since it seems App related, I'm not sure what to offer you.  I guess the only suggestion I have is for you to reboot your iPad and then try again.  To reboot, hold the power and home buttons at the same time for at least 10 seconds (keep holding past the swipe to shut down bar if it appears) until the Apple Logo appears, then let go of both buttons and your iPad will restart.  You won't lose any settings or data, so it's worth a shot.

  • I have downloaded several books into ibooks.  Started reading one and closed it when I was done reading for the day.  Now I want to access other books and when I open ibooks it goes directly to that first book.  What can I do? Help please.

    I have downloaded several books into ibooks.  Started reading one and closed it when I was done reading for the day.  Now I want to access other books and when I open ibooks it goes directly to that first book.  It does not give me the shelf to choose what book I want to read - goes directly to the first book. What can I do? Help please.

    There should be a Library button on the top left. If not ap the middle of the screen to get it to appear.

Maybe you are looking for

  • Cannot open mail after upgrade to Yosimite 10.10.1

    Hello everyone, I cannot open mail after I just update from OS X v10.9 (Mavericks) to Yosimite 10.10.1 and I use console to capture the log as below. Pls. help to find the solution. Thank you Spaide 1/2/2558 BE 7:14:13.222 PM com.apple.xpc.launchd[1]

  • Web Service Request Failed

    Hello, Errors in the EE 4 with RedHat ES 3. Web Service Request Failed The following fault was returned from the web service call: Code HTTP String (404)/axis/services/rpc/webtopsession ------ log ----- Starting service Tomcat-Standalone Apache Tomca

  • Using the TC with another wireless device - non-ethernet

    So I have an odd situation, and I'm hoping someone much smarter than myself can lend a hand. I live in Japan, and my internet is a little unusual.  My router now is a cell-style box with no plugs beyond the power supply.  It's through a company calle

  • Solution Manager 3.2 to  CRM 5.0

    Hi All, I have installed Sol Man 3.2 and CRM 5.0,both on Windows and SQL. Now I want to monitor CRM from Solution Manager. I know that I have to configure Landscape in Sol Man and some other configurations in CRM server. But I do not know hwere to st

  • Huge data overages occurring on many computers

    Not only have I had over 10 gigs used in 4 days, but friends of mine have had the same problem in the last week.  We only do email and google searches.  Verizon denies everything.  I think Verizon should check their satellites and own up to it.  Wish