atarw / material-ui-swing Goto Github PK
View Code? Open in Web Editor NEWA modern, Material Design UI for Java Swing
License: MIT License
A modern, Material Design UI for Java Swing
License: MIT License
Hi, I've just installed your library and the first thing I have noticed is that when I create a text component like JLabel, the text shows like pixelated.
Is any way to solve this?
If I remove the UIManager.setLookAndFeel (new MaterialLookAndFeel()), the text just shows fine.
Thank you!
Hi,
Usually one does not commit and push the target folder to the repo.
You can create a ".gitignore" file on the root folder of the repo with the folders not to upload.
Example: .gitignore
**/target/
**/.svn/
*.iml
**/.idea
As I am using a BasicTaskPaneUI in my GUI, would it be possible to add support for that?
This issue might be related to #57
In earlier version, the buttons looked nice
This is related to: #71
Since OSGi is getting more usecases around (me too!) I think it would be a proper suggestion to modify your project to produce release OSGi bundles that can easily be consumed. For instance, you may use maven's BND plugin to do the job.
It is unclear to me how to customize the LaF without modifying the source code. Example: I would like to have my button background gray. How would I do that?
Currently my approach is to change the MaterialButtonUI to something like
Color bg = (Color)UIManager.get("Button.background");
if(bg != null) button.setBackground(bg);
and change MaterialLookAndFeel.initComponentDefaults to include
table.put ("Button.background", LIGHT_BLUE_400);
In my application code I then use
UIManager.put("Button.background", MaterialColors.GRAY_100)
UIManager.setLookAndFeel(MaterialLookAndFeel())
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.
The combobox react a little bit strange
I think it is good that it changes the color when you hover over it. But I think it should change it back to the default color (white) when you leave the element. Additionally, there are strange black lines / bars when you hover over it. I have really no clue how this can happen, but you can see it pretty well in that gif.
Hi My Name Is Sick, I Not Success To Switch This Look And Feel From Command Line, For The Nimbus No Problem ::::: java -Dswing.defaultlaf=javax.swing.plaf.nimbus.NimbusLookAndFeel -jar MyApp But For This Look And Feel So Material Design No And I Try java -classpath /path/to/material-ui-swing.jar -Dswing.defaultlaf=mdlaf.MaterialLookAndFeel -jar MyApp Not Work
Thank You Sick.
this is brilliant and it helped me a lot. but one issue when I added this to my project is that the icons that use to be transparent png files now are not transparent.
at default swing, I just had opaque set to false and contentAreaFilled set to false so the background is transparent, somehow the jar file disabled this
is it possible to release a patch for that?
i fixed most of them by changing the background colour to the same colour as my background, but some buttons where i implemented a drop shadow in the background image is still giving me problems
after including the jar
at default swing
the drop shadow problem i was talking about. all these are jbuttons
Hi, maybe I missed something but is there a way to set the labels not opaque?
When exiting the application, a NullPointerException
is thrown if a JTextField
is focused.
Presumably, this is because the field loses focus, thus the MaterialTextFieldUI
tries to change color (note how a focused text field will display a blue line at the bottom); however, the Graphics
object passed to getComponentGraphics
is null.
A quick fix might be a simple change in MaterialTextFieldUI.changeColorOnFocus(boolean)
:
//c.paint(c.getGraphics());
if (c.getGraphics() != null) c.paint(c.getGraphics());
(I don't have time to make a pull request right now)
Stacktrace:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at javax.swing.JComponent.getComponentGraphics(JComponent.java:740)
at javax.swing.JComponent.paint(JComponent.java:1001)
at mdlaf.components.textfield.MaterialTextFieldUI.changeColorOnFocus(MaterialTextFieldUI.java:104)
at mdlaf.components.textfield.MaterialTextFieldUI.focusLost(MaterialTextFieldUI.java:96)
at java.awt.AWTEventMulticaster.focusLost(AWTEventMulticaster.java:230)
at java.awt.Component.processFocusEvent(Component.java:6425)
at java.awt.Component.processEvent(Component.java:6289)
at java.awt.Container.processEvent(Container.java:2238)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2296)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1954)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1024)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:690)
at java.awt.Component.dispatchEventImpl(Component.java:4760)
at java.awt.Container.dispatchEventImpl(Container.java:2296)
at java.awt.Component.dispatchEvent(Component.java:4711)
at sun.awt.SunToolkit$1.run(SunToolkit.java:518)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
i've put a checkbox but it only displays a gray background
Imported these:
import mdlaf.MaterialLookAndFeel;
import mdlaf.MaterialUIMovement;
Tried setting the look and feel both in the start of the constructor and main function:
try
{
UIManager.setLookAndFeel(new MaterialLookAndFeel());
}
catch (UnsupportedLookAndFeelException e)
{
e.printStackTrace();
}
Also did the animate thing and works as intended.
MaterialUIMovement animate2 = new MaterialUIMovement(new Color(34, 167, 240), 5, 1000 / 30);
animate2.add(adminB);
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
Hi, would it be possible to mavenize the project?
This is a great work for java.
Maybe you can add a demo as https://github.com/bulenkov/Darcula/tree/master/demo/swingset3 show user
and maybe you can add some color schema as https://bootswatch.com/cosmo/ show ,That is perfect
I can donate or pay to support that work.
Can i use this for production purpose ??
This project has no code license attached. This means that (in many countries) it defaults to "all rights reserved" implied copyright. This means it's technically copyright infringement to use this code.
I would suggest the MIT license, as it allows for anyone to use your code for anything they want, as long as they give you credit for it and include a copy of the MIT license.
I am using this code:
contentPane.setBorder(new DropShadowBorder(new Color(0, 0, 0), 1, 5, .3f, 12, false, false, true, false));
Which results in this issue:
Note that the shadow sits on the pane and not under it like a border should.
I get the same issue when using:
contentPane.setBorder(new DropShadowBorder());
The project is already mavenized.
It can be uploaded to Maven central to make the resolution of dependencies much faster.
Related with this issue:
#39
Hello when I go to apply the theme with the following code:
static{ BasicLookAndFeel matirial = new MaterialLookAndFeel(); try { UIManager.setLookAndFeel(matirial); } catch (Exception ex) { LOGGER.error("Look end feel " + matirial.toString() + " non supportato"); UIManager.getLookAndFeelDefaults(); } }
the theme does not apply to jtable and I get a similar result ...
However nice initiative :)
How can i change color of buttons and textfields ??
Hi,
I got an issue where I got a table with a tablemodel which has a tableformat that includes a Date object.
Somehow the cellrenderer doesn't use the MaterialTableCellRenderer but the DefaultTableRenderer. I think this is not supposed to happen, since I painted my Table in blue and now all Columns are blue when selected, but the cell with the Date object ist still grey.
Thanks :)
Apply Look and Feel in JPasswordField equals JTextField
Have a look over this statement in Netbeans IDE, that's not working in it. And, secondly, I am unable to get the material look and feel after running, Please do see in the issue.
Ramneek
Compared to other LaFs such as native Windows LaF or nimbus, text looks less crisp and clear in text components such as JSpinner, JTextArea and, JEditorPane. With material LaF active, I didn't succeed in assigning a font for these components that looks as good as the default font for the before-mentioned LaFs. Is there a way to use material LaF, and at the same time have a nice-looking font in text components? I am particularly interested in getting JEditorPane displaying HTML formatted text in the same way the native Windows LaF displays it.
This is rather a question than an issue. I am working on a big projects with a couple of hundret buttons, a lot of menus and so on. We used a very old L&F until I found yours. Now what I am missing is like a default mouse over effect on elements. Like when you hover over a menu, it just stays white, or over a button, a tabbedPane or whatever.
Don't get me wrong, I saw that it is possible to set MaterialUIMovement and use it on everything, but that simply doesn't work for me. We use different 3rd party libraries or other stuff where I can't set the MaterialUIMovement for this and that component.
So do you think that adding a default mouse over effect would be possible?
Thanks!
Scroll bar is just like a scrollbar from windows 95, and item select color looks like came from the same
Would really appreciate text area support as it can have multiline.
Hello @vincenzopalazzo
I would show the ">" icon when it is opened (expanded) and the down arrow when it is closed (collapsed). Currently it is the other way round.
How would you recommend implementing this repo? I am running into issues and I suspect I didn't use it correctly
Sorry for keep making future requests, but can you please add support for JSpinner?
Currently, it looks extremely devastating. Thank you in advance :)
WIth this LaF active, nothing happens in JTextArea, if you press the arrow keys, backspace, and all the other command keys. Could't figure out the reason for that.
Currently there is no more hovering effect on a JMenu (tested on Windows 10)
just want to let you know that my project which is making use of your material style laf is now available at https://github.com/wiese42/krayon4sbgn.
Tried this myself but failed. Unclear how to customize the checked/unchecked icon.
Hi,
since your latest updates the buttons look quite strange in my program.
I set button.opaque(false) and now it looks bad for either the JTaskPane Header and the normal JButtons as well.
This is how it looks for me right now:
I am not quite sure, but maybe this is related to your fixes here:
#64
The arrows where increased in size as well and I am not quite sure if I like them, but that might be another issue.
The Material LaF is very nice, thanks for doing this. I'm currently working on a product which uses a SwingX Component JXTaskPane. Would it be possible to add support for this?
It would be really nice if JTree
s were supported.
It seems that currently, they are not supported.
The Material LaF is very nice, but could you please add support for JTabbedPane? Would be nice, it's the only component which looks more or less terrible -> for my school project :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.