Closed GodIHateThis closed 6 years ago
hi, i can't seem to reproduce this, can you send a small/simplified project for me to test?
Thought about what could be the cause.
Since i'm using a public pc with w7, and it has a reduced GUI ( looks kinda like w95 mixed with wxp ), maybe that affects how every look and feel looks like, AND it all depends on the users pc.
For example this is how the program look for me without your look and feel applied:
Edit:Found out that SwingUtilities.updateComponentTreeUI(frame); actually got me closer to your look and feel but the font and the look and feel still glitched out in a few panels. Where should i run this update function?
did a bit of testing, and the error happens because some jcomponents are initialized before the look and feel is set in the main method (e.g. in the constructor, as well as static variables) - once you move all variable instantiation to after the look and feel is applied, everything works fine.
if you don't want to modify your code, putting the updateComponentTreeUI
function at the end of your main method seemed to work fine, although you need to recall MaterialUIMovement.add(...)
afterwards on any animated components to update the hover effect separately
NOTE: i modified MaterialUIMovement
to become purely static so that users don't have to keep instantiating new instances of the class to add animation effects.
now you can just simply use MaterialUIMovement.add(component, color, steps, interval)
.
i hope this helps!
The main fault was that before the updateComponentTreeUI, a important constructor was initializing.
You should put SwingUtilities.updateComponentTreeUI(JFrame); in the readme thing just in case
Imported these:
Tried setting the look and feel both in the start of the constructor and main function:
Also did the animate thing and works as intended.
Also tried the demo and the buttons look different ( like they're supposed to look because of the look and feel )
Am i supposed to apply something to the components first?
PS: don't know if this is the right place to ask questions