The easiest way to use one of these libraries is to add it to Maven, then make minor modifications to your code to invoke the theme. My favorite is FlatLaf, but there are very good themes by NetBeans, IntelliJ, and many others under a variety of different licenses to fit any project. You can find LAF libraries by searching for "laf" on sites like, or on popular coding sites like GitLab or GitHub. The few that are bundled with Java suffice in a pinch, but newer ones are available, and you can bundle those libraries with your code to give your application a different theme. Java Swing gets its theme from Look and Feel (LAF) libraries. (Seth Kenlon, CC BY-SA 4.0) Look and Feel Java libraries Run that in the Java IDE of your choice or with Java directly: $ java App.java SetDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) JRadioButton rad_world = new JRadioButton("World") Window.add(Box.createRigidArea(new Dimension(10, 15))) JButton btn_hello = new JButton("Hello") ītn_tSize(new Dimension(80, 20)) tLayout(new BoxLayout(window, BoxLayout.X_AXIS)) You can see a simpler version for yourself with this demo code: package 2app
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |