How to take the Jinternalframe Side Options Button

Asked

Viewed 162 times

0

Hello, I wish to remove this side option button from my Jinternalframe: print da tela

After reading in some places, I saw that theoretically this employee command to remove the button:

((BasicInternalFrameUI)this.getUI()).setNorthPane(null);

When I try to use this, I get the following error:

Main.java:165: error: cannot find symbol
        ((BasicInternalFrameUI)this.getUI()).setNorthPane(null);
          ^
  symbol:   class BasicInternalFrameUI
  location: class Window
1 erro

Follow, my code word:


class Window extends JInternalFrame{
    Window(String name,  int id){
        [...]
        ((BasicInternalFrameUI)this.getUI()).setNorthPane(null);

        [...]
    }
    public void setPosition() {
        [...]
        }
    }

class Main{
    public static void main(String args[]) {
        [...]
    }
}
  • In order for us to see the problem more broadly, it is essential to test, however, your code, as it is only a fragment, does not allow this. If possible, provide a reduced version of your code, that it is possible to run only the problem so that we can help you ;)

1 answer

0

Try to put this in the class builder.

setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
BasicInternalFrameUI bi = (BasicInternalFrameUI)this.getUI();
bi.setNorthPane(null);

This removes the options menu, but also the edge. You can make a button close and minimize customized too, if you want to keep, but there goes the taste.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.