Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internalframe and frame image/icon #122

Closed
Chrriis opened this issue Jul 3, 2020 · 2 comments
Closed

Internalframe and frame image/icon #122

Chrriis opened this issue Jul 3, 2020 · 2 comments
Milestone

Comments

@Chrriis
Copy link
Contributor

Chrriis commented Jul 3, 2020

System L&F shows the Java icon for frames and internal frames that don't have one:
InternalFrame2

FlatLaf shows the Java icon for frames (whether or not the frame is decorated), but not for internal frames:
InternalFrame1

I think the internal frame should have the same default icon than the frame.
If it cannot do that, it should have its own icon or the space reserved for the missing icon (matter of taste?).

One thing that would be great is to have a way to replace the default icon used by frames and internal frames (to replace the Java icon). I understand that for frames you need multiple images (image list) while for internal frames it is a single icon.

@DevCharly
Copy link
Collaborator

Thx, fixed in master branch.

The default icon (the duke) can be replaced by setting UI value InternalFrame.icon to any javax.swing.Icon implementation:

UIManager.put( "InternalFrame.icon", new FlatFileViewFloppyDriveIcon() );

To use multiple bitmap images, you can use:

List<Image> images = ...;
UIManager.put( "InternalFrame.icon", FlatTitlePaneIcon.create( images, new Dimension( 16, 16 ) ) );

@DevCharly DevCharly added this to the 0.38 milestone Jul 6, 2020
@Chrriis
Copy link
Contributor Author

Chrriis commented Jul 6, 2020

Thanks, works as expected!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants