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

Not an issue. How can I change the color of the unselected TextField to #232323? #46

Closed
ghost opened this issue Sep 4, 2018 · 8 comments

Comments

@ghost
Copy link

ghost commented Sep 4, 2018

Sorry about that awful question, but I've tried to change on the project and build using netbeans but it gives me an error when I put the jar on my project.

I can't find a way to do this.

@ghost ghost changed the title Not an issued. How can I change the color of the unselected TextField to #0c0c0c? Not an issued. How can I change the color of the unselected TextField to #232323? Sep 4, 2018
@ghost
Copy link
Author

ghost commented Sep 4, 2018

Exception in thread "main" java.lang.ExceptionInInitializerError
at mdlaf.MaterialLookAndFeel.initComponentDefaults(MaterialLookAndFeel.java:148)
at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:148)
at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1577)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:539)
at MainClass.MainClass.main(MainClass.java:29)
Caused by: java.lang.IllegalArgumentException: input == null!
at javax.imageio.ImageIO.read(ImageIO.java:1348)
at mdlaf.utils.MaterialImages.loadImg(MaterialImages.java:36)
at mdlaf.utils.MaterialImages.(MaterialImages.java:30)
... 5 more
Java Result: 1

@vincenzopalazzo
Copy link
Collaborator

Hello @khadapps ,
I was thinking about how to make personalization easier, while I give you a hand in personalization, try the following piece of code after setting the look and feel.

UIManager.put("TextField.inactiveBackground", new Color(35, 35, 35);

I hope to be proved helpful

@ghost
Copy link
Author

ghost commented Sep 4, 2018

Many thanks Vincenzo!
But I can't make it work...
I've tried to change "inactiveBackground" to "unfocusedBackground" but neither of them works.

@ghost ghost changed the title Not an issued. How can I change the color of the unselected TextField to #232323? Not an issue. How can I change the color of the unselected TextField to #232323? Sep 4, 2018
@vincenzopalazzo
Copy link
Collaborator

vincenzopalazzo commented Sep 4, 2018

@khadapps
From your exception it seems that the look and feel can not find the images that he uses himself to render the components, can you please post the open jar screen?
it should have done something similar but not the same because I use a different pom.xml
screenshot from 2018-09-04 20-10-44

@atarw
Copy link
Owner

atarw commented Sep 4, 2018

Wait I'm a bit confused. Is the issue that Netbeans doesn't load the jar or does it have to do with the text field?

@vincenzopalazzo
Copy link
Collaborator

@atarw The problem is not netbinse 'cause I test the look and feel I always do it with him, rather I think his jar is corrupt.

Yesterday I was fixing a few things on my fork and I got a similar error, very similar so I think the JtextField is ok

ps: Excuse the intrusion

@ghost
Copy link
Author

ghost commented Sep 6, 2018

Hello, my problem is just that I can't change the color of the unfocused background of the JTextField.
So far I've tried things like the code UIManager.put("TextField.inactiveBackground", new Color(35, 35, 35); code but it didn't works.

@atarw
Copy link
Owner

atarw commented Sep 7, 2018

Fixed!

To change the active color of a JTextfield, change JTextfield.selectionColor, or for the unfocused background, changing UIManager.put("TextField.inactiveBackground", ...) should work.

You can also change JTextField.selectionTextColor and UIManager.put("TextField.inactiveForeground", ...) for more customization

@atarw atarw closed this as completed Sep 7, 2018
vincenzopalazzo referenced this issue in vincenzopalazzo/material-ui-swing Sep 7, 2018
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