0

Below code is removing the title bar of JInternal Frame but when I execute the program it only displays JFrame to display JInternalFrame I have to manually minimize the the JFrame and again need to maximize JFrame to view JInternalFrame

    for (int k = 0; k < num; k++) 
    {

        jif[k] = new JInternalFrame();

        ((BasicInternalFrameUI) jif[k].getUI()).setNorthPane(null);

        jif[k].setBounds(Integer.parseInt(xCordinate[k]),   
        Integer.parseInt(yCordinate[k]), Integer.parseInt(width[k]), 
        Integer.parseInt(height[k]));

        jif[k].setBorder(null);

        frame.add(jif[k]);

        jif[k].setVisible(true);

  }
 frame.setVisible(true);
Piyush Yawalkar
  • 252
  • 1
  • 4
  • 17
  • 1
    The point of a JDesktopPane is to drag around internal frames and minimize them etc. If you remove the title bar you lose all that functionality. If you don't want the title bar of the internal frame, then why are you using a JDesktopPane with JInternalFrames? Just use a regular panel with other panels as the child components. – camickr Aug 03 '15 at 04:22
  • Actually I want to play videos in JInternalFrame using vlcj and for that i require setContentPane() method which is not available in JPanel so I am using JInternalFrame – Piyush Yawalkar Aug 03 '15 at 04:26
  • 1
    @PiyushYawalkar What you're trying to do probably won't work (playing video is a `JInternalFrame` using vlcj) as vlcj actually requires a AWT component (something like `Canvas`) to play it's videos on, this throws out the z-ordering support which you get from Swing components, meaning that it will likely paint over the top of any other content you might have – MadProgrammer Aug 03 '15 at 04:29
  • 1
    Why do you think you need setContentPane() method? Have you seen this posting: http://stackoverflow.com/questions/13440760/embedding-vlcj-in-jpanel – camickr Aug 03 '15 at 04:30
  • 1
    `EmbeddedMediaPlayerComponent` extends from `java.awt.Panel`, you can add it to any `Container`, but as I said, you'll lose Swing's z-ordering capabilities. Even [this offical example](http://capricasoftware.co.uk/#/projects/vlcj/tutorial/basic-controls) simply adds the `EmbeddedMediaPlayerComponent` to a `JPanel` – MadProgrammer Aug 03 '15 at 04:33
  • Thanks a lot everybody it works on JPanel too – Piyush Yawalkar Aug 03 '15 at 05:02
  • got one more problem I want to play multiple videos so I want to setBounds for JPanel but it it is loaded in complete JFrame even if i am giving the coordinates properly the code was working fine with JInternalFrame only I had to minimize and maximize the JFrame – Piyush Yawalkar Aug 03 '15 at 05:20
  • Then maybe you can go back to using a JInternalFrame. You can use: `internalFrame.putClientProperty("JInternalFrame.isPalette", Boolean.TRUE);`. This property will remove all the buttons from the title bar and just leave a small draggable area at the top. Otherwise if you want to keep using the JPanel then you need to be aware of the layout manager that is being used. – camickr Aug 03 '15 at 14:24

0 Answers0