look-and-feel

JTable and Look and Feels

空扰寡人 提交于 2019-12-24 08:24:21
问题 I have small problem with changing look and feel of an object. In my app I have public class JavaCommander extends JFrame and in this class I have JTable that is constructed with my own table model. Everything works fine, but as I said there is a problem when I want to change look and feel. In menu bar I have a menu with available look and feels. menuBar=new JMenuBar(); JMenu lookMenu=new JMenu("Look and Feel"); UIManager.LookAndFeelInfo[] info= UIManager.getInstalledLookAndFeels();

Java Look-And-Feel for Tray Messages on Ubuntu

人走茶凉 提交于 2019-12-24 04:07:36
问题 I'm displaying messages on the system tray via trayIcon.displayMessage(...) but they don't look nice. I tried to change their look and feel to the system standard, but calling UIManager.setLookAndFeel(...) before creating the icon didn't change anything. UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); tray = SystemTray.getSystemTray(); popup = new PopupMenu(); trayIcon = new TrayIcon(image, "Tray Demo", popup); tray.add(trayIcon); trayIcon.displayMessage("Tray Test",

Scrollbars for Infinite Document?

限于喜欢 提交于 2019-12-24 02:19:05
问题 Is there a standard Aqua way to handle a practically infinite document? For example, imagine a level editor for a tile-based game. The level has no preset size (though it's technically limited by NSInteger 's size); tiles can be placed anywhere on the grid. Is there a standard interface for scrolling through such a document? I can't simply limit the scrolling to areas that already have tiles, because the user needs to be able to add tiles outside that boundary. Arbitrarily creating a level

Java: JButton with custom Shape: Fill with Metal Look and Feel Gradient

走远了吗. 提交于 2019-12-24 01:53:30
问题 I have a new class derived from JButton which gives me the shape of a Enter-Button. Now I want to have it filled with the same gradient as the default JButton . But I do not know. How I can do this? At the moment it is filled with plain black color. import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Point; import java.awt.Polygon; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JPanel; public class EnterButton extends JButton { private Polygon

How to left align JFrame Title text between different OSs

烈酒焚心 提交于 2019-12-24 00:15:31
问题 It looks like the OS is controlling the whole JFrame title bar. I tried using: UIManager.setLookAndFeel() To change the Look and Feel, but it doesn't seem to affect the title bar. On my Windows machine the default is left aligned, but on my Linux machine it's centered, and somehow, I'd like to try to always show the title text left aligned. I saw one example where they basically built every element of the title bar from scratch, and I'd rather not go there. Is there any other way to do it?

how to change background color for nimbus look and feel using java

做~自己de王妃 提交于 2019-12-23 20:08:39
问题 In Java Swing application, I am trying nimbus look and feel. It looks excellent in JdesktopPane control but i want the different color for my all desktoppane but theme is fine. Is there any way to change the background color of nimbus look and feel? Here is the sample code to apply the nimbus look and feel. try { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } } } catch

JTable TableCellRenderer background with NimbusLookAndFeel color problem

时间秒杀一切 提交于 2019-12-23 18:52:06
问题 I'm using NimbusLookAndFeel. With this look and feel JTable's cell background are alternatively white and light grey (it depends on the row number). Now, I'm writing some custom cell renderer implementing TableCellRenderer. I need to set the background of these renderers according to the position of the cell in the JTable. public class MyCellRenderer extends JLabel implements TableCellRenderer{ @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean

Default button input map in a synth look and feel?

馋奶兔 提交于 2019-12-23 12:27:10
问题 I am trying to use the UIManager to get and clear some default key bindings so that the spacebar doesn't activate my JButtons, as explained here. Problem is, likely due to my synth look and feel, (InputMap)UIManager.get("Button.focusInputMap"); returns a null . Does anyone know of a way to easily clear components input maps some other way, or why the UIManager returns a null in this case? Any tips are appreciated, thanks beforehand. 回答1: I'm not near a computer to try this, but looking at the

Do Java GUIs display the same on all operating systems? [closed]

被刻印的时光 ゝ 提交于 2019-12-23 05:15:34
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . Do programs written in Java that use components from Swing to build their GUI display exactly the same on all operating systems? EDIT:

Look of the app - Py2exe / wxPython

Deadly 提交于 2019-12-22 18:38:20
问题 So my problem is the look and feel from my application, as it looks like an old look app. It is an wxPython application, and on python it runs fine and looks fine, but when I convert it to .exe using py2exe, the look is just bad. Now I know that if you are using XP you need some manifest to correct it but I am in other circumstances. I'm using Windows 7, and I'm using Python 2.6 (Yes, I am including the DLL's and the Microsoft.VC90.CRT.manifest). So my question is how can I solve this under