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

JOptionPane - default button look #19

Closed
zanderson9 opened this issue Apr 9, 2019 · 18 comments
Closed

JOptionPane - default button look #19

zanderson9 opened this issue Apr 9, 2019 · 18 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@zanderson9
Copy link
Collaborator

When using JOptionPane in Swing and specifying Ok and Cancel buttons in its constructor, Swing UI renders the buttons such that it is visually obvious which button is "default", for example, by drawing a rectangle around default (OK) button in a background.
Swing code example:
JOptionPane op =
new JOptionPane(
loginDialogContents,
JOptionPane.PLAIN_MESSAGE,
JOptionPane.OK_CANCEL_OPTION
);

This visual indicator of a default button is lost when using material-ui-swing library.
Same Option Pane displays both OK and Cancel the same way, user cannot tell which button is default.
Can the visual indicator of which button is default be restored with the "material" look under material-ui-swing?

@vincenzopalazzo
Copy link
Owner

vincenzopalazzo commented Apr 9, 2019

Do you like this effect?
focusableFalse

vincenzopalazzo added a commit that referenced this issue Apr 9, 2019
Now the look and fell not extended MetalLookAndFeel but BasicLookAndFell, I Added a shortcut and I work on 
- #21
- #19
- #20
- #22
@zanderson9
Copy link
Collaborator Author

yes, looks great!

@srcarter3
Copy link

Hi Vincent,
That screenshot you sent looks good with the default colors, but in our color scheme it doesn't look as good.
Maybe a thicker border would be good? Also, us dark gray, not black? And it doesn't seem to be completely aligned (closer to top and left, than bottom and right?).
I've attached a picture of how the default button looked in the old look and feel (with the default colors though), and how it looks in our new colors with your look and feel.
newDefault
oldDefault

@vincenzopalazzo
Copy link
Owner

I will work on a smarter way to change colors

@lilili87222
Copy link

joption
joption2

Is it possible the joption look like this

@lilili87222
Copy link

lilili87222 commented Apr 11, 2019

joption3
It may be better to remove the projection effect.

and maybe the icon can be removed.

@vincenzopalazzo
Copy link
Owner

Hi @lilili87222, Ok I try to remove the projection effect and the icon will be removed in all the JOptionPane

@vincenzopalazzo
Copy link
Owner

HI @lilili87222,
I can try this, but I wouldn't know if I could do it, and above all if it's a solution that does not give problems with possible configurations of the bread option, unfortunately from UI I can't interfere with anything other than with the events, look here

No, I like the effect that joption bread has without edges, but you can set the border you like the most by editing UIManager, like this
UIManager.put("OptionPane.border", YOUR_BORDER);

@vincenzopalazzo
Copy link
Owner

hi @zanderson9, @srcarter3

This bug is still present?

@srcarter3
Copy link

The default button looks the same as a button in Focus. And it loses it's look as soon as a different button gains focus. So yes, I would say this hasn't been addressed completely.

@vincenzopalazzo
Copy link
Owner

I will return to it

@vincenzopalazzo
Copy link
Owner

Hi @lilili87222, I had an idea for creating the Joption pane cool,
I created a repo for swingx, the found into my repo, do we interfere with the construction of jXOption pane and add a constant that allows us to enable and disable the painting of JDialog?

it's just an idea, I have to study the code to see if it's possible and I have to see if I can fix an error in swingx core, but I can try when I have time, in fact, if you want to help me we can work together to create an OpenSwingX ahahah.

Sorry if I resume the speech, but I am native to java because in my course of study this language is dealt with swing technology and I dislike to know that I do not have the cool media available for my applications.

@vincenzopalazzo
Copy link
Owner

vincenzopalazzo commented Apr 18, 2019

@lilili87222, I tried to follow your advice with the JDialog look, I am happy is you send me the example for the effect button where this is the focus

there are my last commit
#36

@lilili87222
Copy link

Swingx is another big project. As you said, keeping the skin properties of the material-ui-swing project, reducing the dependency as much as possible, and making the old project available, may be a good choice. Just like https://github.com/bulenkov/Darcula, a small jar can be used in various swing projects, which is great.
If some effects are not available through the skin interface, consider adding a branch project that expands on the basis of material-ui-swing to complement the hard-to-implement effects.

@vincenzopalazzo
Copy link
Owner

Hi @srcarter3 @zanderson9,

I added this change

This is the reference for the changes
I attend your feedback, thanks so much

@zanderson9
Copy link
Collaborator Author

Hi @vincenzopalazzo,
we just want to note that for future development the "Default" button look is still not quite nailed down. It is not critical for our upcoming beta release of JMARS, but we would like to improve the look of "Default" button going forward, in the subsequent releases of the library.

@vincenzopalazzo
Copy link
Owner

Hi @zanderson9,

This change is in the program but get a version personalizable with swing in more difficult.
The solution easy is to tie the look and fell the color, an example The Darcula theme has the button default blue but we do not to tie an color, so I will work for the good solution, but not in the version 1.0 because of the solution needed the tests.

Sorry.

I have a question for you, can you open an issue with the screenshot the tabbed pane component material so I add the new label if any person wants to collaborate with us that adding a new support component. Thanks

@zanderson9
Copy link
Collaborator Author

yes, I posted New Issue for the tabbed pane component.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants