/** Called by JMF when the Player has something to tell us about. */ public synchronized void controllerUpdate(ControllerEvent event) { // System.out.println("controllerUpdate(" + event + ")"); if (event instanceof RealizeCompleteEvent) { if ((visualComponent = thePlayer.getVisualComponent()) != null) cp.add(BorderLayout.CENTER, visualComponent); if ((controlComponent = thePlayer.getControlPanelComponent()) != null) cp.add(BorderLayout.SOUTH, controlComponent); // resize the main window if (parentFrame != null) { parentFrame.pack(); parentFrame.setTitle(mediaName); } } }
Component controls = mediaPlayer.getControlPanelComponent(); f.add(video,BorderLayout.CENTER); f.add(controls,BorderLayout.SOUTH);