Inserting a Swing BoxLayout graphically via Netbeans palette - swing

I'm trying to insert a Swing BoxLayout to my jFrame graphically using netbeans palette, but i can't find any way to do it
Here is my my NB palette
any suggestion or help will be welcomed :)
Edit:
Problem resolved thanks to #kyal-bond 's solution : just i have to put a Panel, then right click on it and choose "Set layout" then choosing "Box Layout".
Thank you again #kyal-bond ^^

You cannot add Layouts to JFrames, first add a Panel to that frame and then you may add layouts to that. JFrames are kind of just window containers and don't actually do much in terms of editing layouts.

Related

tab navigator but spread over two rows in flex

I currently use a Tab Navigator in my flex project and ideally I would like to continue to use it but the problem is there is quite a few tabs and almost all of them end in "..." because their is not enough space to display the entire header. is it possible to display the navigator over two rows?
I'm quite new to flex so if this is an easy thing then apologies.
I think the following link can help you out. Just Check this...
Hope it will help
http://flexponential.com/2011/10/23/enable-scrolling-in-the-tab-bar-of-a-tabbedviewnavigator/
If you are using Spark Tab Bar, the answer from the link above will work. If you are using the old Halo Tab Navigator, there is an excellent component, SuperTabNavigator available as a part of Flex lib.

An overlay GTK toolbar/widget

I am writing a custom application in C using GTK+2.0 and Cairo. Just for learning purposes (and if successful, then for deployment), I wish to recreate something similar to a overlay toolbar/widget (I am sorry if the terminology is not correct) that appears when a mouse moves over a given area on the window, and disappears when the mouse moves away. The toolbar, as I imagine, should appear on top of the existing widgets without displacing them or altering the widget packing in any way. Is it possible to accomplish? If yes, can you please point me to relevant tutorials/examples and/or outline a way to do the same?
Thanks in advance.
Not sure this is easily doable in GTK2. However, I learned recently that there's the GtkLayout widget which allows pixel exact rendering of widgets, so you can even display some widgets over others. Or you may implement your own container widget.
Please note that since GTK3, there's GtkOverlay which seem to do what you want.
You may also give a look to Clutter, which might allow this. Furthermore, there are projects of merging GTK and Clutter for GTK 4.
The little known GtkHandleBox is capable of doing what you want. I must warn you it is deprecated in GTK+3 because is going against the usual UI direction. Also, the correct positioning will be subject to the windows manager quirks, so I'd expect some issue in this regard.

SWING JPanel / JXPanel Animation

In SWING is there a good/easy way of animating a the show and hide of a JPanel? I would like animate the expand of a JPanel height. I figured I could use a timer and increment the height, but was hoping there was something already out there.
Here is an example: (I know this is a web app.... sry). Click Login at the top.
http://web-kreation.com/demos/Sliding_login_panel_jquery/#
Thanks
SwingX comes with a JXCollapsiblePanel which might be helpful. Its demo shows it in action (as taskPanes) at the left - that's the part for choosing the demos.
I would recommend Trident animation framework. I will simplify proper animation based on the properties of your panel
I'd recommend the TimingFramework: http://java.net/projects/timingframework/
It was written by some of the guys from the Swing team before the left a few years ago.
If you really want to look into this in some detail I would recommend picking up Filthy Rich Clients by Chet Hausse and Romain Guy. It's the definitive book about how to do fancy things in a Swing app.

Java Swing and Netbeans GUI Designer: How to remove small gaps between components when I set them invisible?

I am a newcomer to Java Swing. I am using the GUI builder of Netbeans.
I have three main panels for three different views in my application. These views can be switched by a menu on the left.
I switch these views by setting one visible and setting the other two invisible. It works but there is a little problem.
In order to achieve this, I had to put three JScrollPanes next to each other horizontally in the GUI builder. Whenever I switch to a view, the small gaps between the visible component and the invisible ones remain when the visible JScrollPane resizes itself to fill the entire window. It makes the application look quite ugly. The same thing happens when I place them vertically.
How can I fix this by using the GUI builder? I can't make changes to the code for the interface design, obviously.
Here is a very crude drawing of the problem, I hope it's clear enough: Link
Using only one JScrollPane is not an option, because they have different layout managers and will have lots and lots of components. It would not be feasible in terms of performance to render everything from the beginning when a user changes the view.
Thanks in advance,
Emre
Fixed the problem myself.
You can prevent this by right clicking to each JPanel component in Netbeans, choosing "Space Around Component..." from the popup menu and set the corresponding spaces to 0 by hand.
Updating the answer to NetBeans 8. You now right-click the component and select "Edit Layout Space" and manually enter the value 0 in the direction with you would like the spacing removed.

Pretty JPanels in Swing

I'm currently working on making my Swing application look better. I want to achieve something along these lines:
The idea is for each box to have a pretty header with a background similar to the above image. The closest I can get to anything like this using basic Swing components is adding a TitledBorder but this is nothing close to what I want.
I have experiment with JXTaskPane from SwingX, which is close:
http://img411.imageshack.us/img411/6866/image431.png
And near perfect, except for the fact that it's collapsible and it doesn't appear possible to make it not collapsible.
Are there any obvious solutions I'm missing here? Otherwise I figure extending JPanel and creating a special header for it using a image for the background of the header.
Any pointers greatly appreciated. Thanks.
Since you already looking into SwingX components, why don't you use JXTitledPanel? I think it is very close to what you want to achieve. You can set your own colors there.
Yes, why not write your own custom border or JPanel for that? You customize the painting by overriding the paintComponent-method.