I'm building a small suite of widgets (here) for SWT.
I've done a Slider, but every time I change thevalue with the mouse wheel, it kinda blinks.
The source is available here.
What am I missing here?
I just added SWT.DOUBLE_BUFFERED to the component when instantiating they
Related
I have a Java Swing application that's using "system" look and feel (as i'm using Windows, i'm getting "native Windows" controls in my app). Now, for "branding" reasons i'm trying to enforce particular color on my buttons but i have a problem. I prefer using UIManager but i can't find any property that would let me choose "button mouse over" color.
Take a look at the picture attached please:
Seems like i'm stuck with default Windows "light-blue" color for button mouse over (pointer is not visible in this screenshot).
How can i change that color?
For me only option is some sort of UIManager global variable, i simply can't afford to go through all buttons in my app and override some custom button or add listeners for "mouse enter" and "mouse exit".
The best way to do it is to customize the LAF of your application, using this library TinyLAF.
Very easy to use, with nice control panel to help do some theming and using the created theme file on your project.
Here is a small tutorial on how to use it in case the doc is not too clear
http://yourjavacode.blogspot.com.ng/2013/05/tinylaf-change-your-java-look-and-feel.html
I hope this helped out.
I've just migrated from Netbeans to Idea and got some problems with gui form designer. Is it possible to move and set appropriate component position by mouse? I've tried, but failed to set custom position on the form. As I understand, Idea form design is based on layouts, so position of components changes only from source code.
You have to work with layouts. There's no such thing as 'Design layout' in IntelliJ Idea. However, it helps to design nicer GUIs :)
When you open a dialog in Eclipse, where is a form layout, you can see that when you hover your mouse over some item, its label or space between them, there's an auxiliary arrow shown. Screenshot:
My question is: is there any (simple) way to achieve the same in Java with SWT and JFace?
Regards
No there is no standard way to achieve this through SWT or JFace, as it is not a built in feature. It is not that difficult to add on your own though.
Have a look at this ConfigurationBlock.java file from the PDE source. This class is the base for all option blocks in PDE preference pages. This exact same code snippet is also used by JDT but it has a different copy in OptionConfigurationBlock.java.
The method that gets called for each combo control is ConfigurationBlock#addHighlight(..), which is responsible for adding the highlight when the control is in focus or when mouse is hovering over its label.
I would like to implement a list of interactive buttons using Swing. It is something similar as on the picture (from NetBeans UI designer):
You can drag and drop the items to a canvas, or single click on the item and then single click on the canvas. However, I don't know which swing components I should use. Are that JList or JButtons or something different?
There is a tutorial avalaible on how to achieve such functionality. It is utilizing the NetBeans Palette API, which makes you dependent on NetBeans as Framework, not IDE.
Depending on the goal, you might want to look into developing for the NetBeans Platform.
Is there a way to write a Java Swing application with a custom chrome? Please take a look* at the frame for Microsoft's Zune 4.0 software.
I realize that colors, the shape of scroll bars, etc. are controlled by skins or looks and feels. Right now I'm trying to tackle the native window which houses the java components--the title bar mainly.
Thanks
(*) http://www.winsupersite.com/zune/zune4_shots.asp
By default the frame of a JFrame is native. This can be removed by calling Frame.setUndecorated. The Sun Window PL&F does not provide a title bar. You could hack aJInternalFrame so that it draws the frame, although that probably isn't going to be as easy as it may seem. Of course, if you are going the full custom route, you can draw whatever you want. From 6u10, Sun's JRE also provides APIs to make windows transparent and non-rectangular.
No part of a Swing component's look and feel is "native" in any way. Swing components are "lightweight", which means they are entirely drawn on the Java side, and not at all on the windowing system side.
To create custom "chrome" you create the UI delegates for one or more components. In yor case, you'd want to muck around with the delegates for JRootPane and JInternalFrame.
The Look and Feel of Swing apps are pluggable..that is it can change on the fly. You can create your own look and feel but its not a simple undertaking. To get started this tutorial explains. This article does a little more.
This project demonstrates what could be done. So its up to your imagination.