look-and-feel

JButton background images

笑着哭i 提交于 2019-12-11 01:37:05
问题 I'm writign a POS system(point of sale) for fun. A typical feature of a POS system is buttons that have different background colors for different products. But I don't mean the background behind the button's image, i mean like in this random picture I got off google images: Edit: Note I changed the look and feel to the system one I need to do something like THAT with my buttons. I know a few ways this COULD be possible: Creating a look and feel for my buttons? Completely overriding the

Custom Matlab pushbutton appearance with Java

耗尽温柔 提交于 2019-12-11 00:32:35
问题 I want to change the appearance of a Matlab pushbutton with Java. For it, I use the application Findjobj. However, because of I do not know Java, I have troubles to use Java classes properly that I need to get my button has rounded corners. Based on the information found here), I have tried to set up the button with the class BorderFactory: hButton = uicontrol('string','click me!'); jButton = findjobj(hButton); jButton.setCursor(java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jButton.setBorder

Using Java to develop cross-platform, fonts scaling differently on different platforms

牧云@^-^@ 提交于 2019-12-10 23:08:11
问题 I am making some software for my university. A GUI is required. In the first revision of it, I had it use the System Look and Feel (so it would look like a native application within Linux/Mac/Windows). I found this to be cumbersome as I had to make all of my JLabels different sized based on the OS (regardless of resolution/pixel density/etc). After doing this I was like "okay, I'm NOT going to go through with this again" so I decided to not use the System look and feel and try out Nimbus. It

Changing the defauls key values for JButton in Nimbus LaF

∥☆過路亽.° 提交于 2019-12-10 22:36:56
问题 I have a two Buttons in my program JButton button1 = new JButton(); button1.setText("First Button"); JButton button2 = new JButton("Second Button"); I have tried to change the LaF of the button, I am able to change the button background color using the following code UIManager.put(Button.background new color(134,201,236)); But when i tried to change the other key values like "Button.disabled" , "Button[Default+Focused+Pressed].backgroundPainter" the code did not work for me. Could someone

How to use Windows XP theme in Java/Swing applications?

只谈情不闲聊 提交于 2019-12-10 19:52:12
问题 I have to use Windows XP theme in my Java/Swing project. There are classes like below. com.sun.java.swing.plaf.windows.WindowsLookAndFeel WindowsLookAndFeel can be used when someone wants to use the same theme as currently applied by the user. com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel WindowsClassicLookAndFeel can be used when someone wants to specifically use the windows classic theme. When we change a theme of Windows from XP to classic, swing UI also changes from XP to

“java.lang.InternalError: HTHEME is null” on arbitrary JREs (Windows)

孤街醉人 提交于 2019-12-10 19:31:52
问题 We are getting an exception when changing the Windows Theme on Windows 7 (via right-click Desktop > Personalize ) while our Java app is running. Searching the web did produce some results, but they are mostly about java bug reports that claim to have been resolved ages ago. This is the trimmed and partially obfuscated stack trace: java.lang.InternalError: HTHEME is null at sun.awt.windows.ThemeReader.paintBackground(Native Method) at sun.awt.windows.ThemeReader.paintBackground(Unknown Source)

jSlider go to clicked position - problem only on Macintosh

▼魔方 西西 提交于 2019-12-10 18:26:25
问题 I have been using the above MetalSliderUI solution for all my JSliders. Windows users have been happy with it. I appreciate finding this solution on stackoverflow.com The solution was discussed here: JSlider question: Position after leftclick Now recently a MAC OSX/64bit user is trying to use my software and he gets null pointer exceptions from the MetalSliderUI references. Sample of code which I added to JFrame's constructor: // Radio Window Elecraft K3 RFPWR Slider - when click on slider //

Java Swing Range Slider U.I

為{幸葍}努か 提交于 2019-12-10 17:27:10
问题 I needed a slider with two knobs on it (representing a range) and I found this nifty one here. However, they created their own U.I. which extends Java's BasicSliderUI. They override the paint method to draw their own knobs. I would like to use the default knobs based on the current look and feel . I tried calling BasicSliderUI 's paintThumb method, but this gives me a generic looking knob which doesn't seem to be tied to the current look and feel. As far as I can tell, JSlider gets its U.I.

Open source laf[look n feel] for java swing application

允我心安 提交于 2019-12-10 17:16:26
问题 Which are Open source lafs[look n feel] for java swing application? 回答1: Here is a great answer on another question: Java Look & Feel Edit : Don't forget the system look and feel: try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) {} 回答2: Substance LAF from Kirill Grouchnikov is the best I know. 回答3: Don't forget Seaglass : a LAF inspired by the OSX theme and, well, you knew it, seaglass (beautiful!) Nimbus : The standard Java L&F for Java 6 来源:

Is there a way to get a look and feel of windows 8 metro on java desktop application?

你说的曾经没有我的故事 提交于 2019-12-10 15:33:52
问题 I am really struggling to find a good answer to this question, as stated in the Title. I am currently developing an application that will be desktop only with no CSS or any internet parts at all. I would like it to look like the metro look of Windows 8. I'm not talking about the layout but the look and feel. I would especially like the buttons that are square and not rounded but all the other flat square look and feel too. The following link is the opposite of what I'm looking for, as a