4

I'm using a JInternalFrame and I want to remove the dropdown in the upper left of the frame, as it serves no purpose (I've disabled resizeable, closable, etc.)

Persistent little dropdown arrow

I don't see a property for this, and I don't want to remove the entire title bar, as the title is necessary. I've looked around online, and basically come up empty here. I'm hoping it's something simple that I've just overlooked, as this is my first time using JInternalFrame, and I'm not exactly a GUI kind of guy to begin with.

Nate W.
  • 9,141
  • 6
  • 43
  • 65
tredontho
  • 1,273
  • 10
  • 14

3 Answers3

10
internalframe.setFrameIcon(null);

Edit: hack to remove system menu in Windows:

BasicInternalFrameUI ui = (BasicInternalFrameUI)internalFrame.getUI();
Container north = (Container)ui.getNorthPane();
north.remove(0);
north.validate();
north.repaint();
camickr
  • 321,443
  • 19
  • 166
  • 288
  • Works on Metal but not on Windows LAF. With Windows the icon goes away but the menu still displays when the user clicks. – prunge Nov 16 '11 at 06:00
  • On Nimbus LAF, to also remove menu from right click action: `internalframe.setComponentPopupMenu(null);` – bourne2program Sep 23 '21 at 21:03
1

The relevant Icon in The Synth Look and Feel, among the Nimbus Defaults, appears to have this key:

InternalFrame:InternalFrameTitlePane:"InternalFrameTitlePane.menuButton".icon

You may be able to use the approach shown in A Synth Example to replace the Icon.

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
0
setFrameIcon(anyBigImageThatCantBeDisplayed);

I´ve tried null parameter and got some visual issues...

enter image description here

So i added a big image(no background) that was already on my resource folder and the icon was no longer displayed as the menu...

enter image description here

Wesos de Queso
  • 1,526
  • 1
  • 21
  • 23
  • 1
    Hello Wesos, thank you for your answer, however code only answers are discouraged. Can you edit this to explain why this code works and how it answers the question? Thanks! – Tim Malone Jun 09 '16 at 00:23