I am working on ribbons using Java Swing technology. I am not using the already made framework called Flamingo (it's not giving the style I want), rather I am implementing it via the netbeans swing drag and drop. I want to make the panels collapse into drop down when the window is resized.
Like if we resized the window to be very small, we will have 3 dropdowns: File, Preferences and Help. Each drop down gives the elements in each section.
Any ideas how to achieve this?
Related
Multi-window applications often have a main-window, and all other windows are kind of 'parented' to it. Minimizing such a sub-window will hide its content and show the title-bar at the bottom-left of the screen. Also, these windows do not have their own Icon in the Task-bar, only the main-window does.
How can I make a window being attached this way to another window?
If that is possible, is it also possible without a referenfe to the actual main window?
#2: I'm embedding Java into such an application and I would like to be able to use awt or swing additionally to the native dialogs, which have this behavior by default.
See How to Use Internal Frames.
have look at JInternalFrames for MDI application
read Oracle tutorial, try code example
i like the style of netbeans palette (Window -> Palette, best seen when creating a gui). i would like to integrate a similar collapsable panel in my application, but i have no idea how to find this component. i guess its not a standard swing component, although it looks kind of similar to a jTree. i poked arround the netbeans framework, but i couldnt find the corresponding class.
I know about swingx's JXTaskPane, but i would really prefer an easy, clean way to hide, show and group ui components, without fancy-animation bloating my app needlessly. The netbeans palette seems just perfect. but how is it called & where can i find it?
In Eclipse Jigloo plugin you can right click on JTable and choose "surrond with JScrollPane".
But in windowbuilder pro plugin I can't find a way to make JTable with JScrollPane
Add a scroll pane to your UI. Then drag and drop the table onto the scroll pane. During the drag over scroll pane window builder will highlight its areas - make sure you drop onto the central one.
Alteratively the following also works nicely;
Add a JTable
Right click on the JTable in the tree view
Select: Surround With > JScrollPane
Another option would be to use NetBeans to do some of your Swing layout.
I've had limited experience with WindowBuilder, but I use NetBeans for designing prototypes and find it much easier for creating UIs. The resulting code generated from NetBeans will also be viewable using WindowBuilder.
I am using WindowBuilder 1.7.0 and Swing designer 1.7.0 in Eclipse in Mac. At first I was finding similar menu like Jigloo which I did not find. My Jigloo always crash in Mac and show license message, so I discarded it :)
Later with some playing, I found how to do it in WindowBuilder, specially if you have already designed the JTable/JTextArea/JTree and do not want to delete it. After that you need to put them scrollable.
You can use the tree view on the left. Normally you cannot drag a component into the scroll view. However add the scroll view in the frame. Set proper layout to the component where you want to put the scroll view. Usually its BorderLayout, may in a JPanel. Drag the JScrollView into target area. Use the tree view for all these actions. Then finally drag the JTree/JTable into the JScrollPane in the frame design view. To my experience this works better. Play with the Layouting of the parent components.
What I have is an Application that uses swing components (jpanel, jbutton, jlabel, etc), however I have to use an old PDF viewer (upgrade is not an option) that is based on java.awt.Applet (com.adobe.acrobat.Viewer). The problem comes when I am trying to display it, it draws properly however since this PDF viewer is inside a JScrollPane, it draws over all of the swing components (over the scroll bars and the menu).
Does anyone know how to make the PDF viewer act nicely and not to draw over other components.
Any suggestions are appriciated
You might look at Mixing heavy and light components, which describes some new support for this. I understand "upgrade is not an option", but the discussion may yield some insight.
I'm using Qt Jambi 4.4 for a project I'm working on (and designing the windows in the Qt Designer eclipse plugin). One of the windows I'd like to use is a preview window which is basically just a window with a QWebView on it. How can I make it so that the QWebView resizes as the window does? I've set the sizePolicy to expanding for both Horizontal and Vertical position. What else do I need to do?
(also bear in mind that I'm a newbie to both Java and eclipse and need to be talked to in stupid people terms on both of those subjects)
UPDATE
Just to illustrate the point, here are a couple of screenshots (I've made the window background bright just to illustrate my point):
alt text http://img13.imageshack.us/img13/2103/screenshot2oi7.jpg
alt text http://img152.imageshack.us/img152/6250/screenshot1mz9.jpg
I don't know Jambi, but with Qt Designer just give the background the focus and then apply a layout from the toolbar. Then the main widget will get resized by that layout manager -- if you don't add that layout manager you'll get the widget resizing but the contents staying at their old positions.
I haven't used qt-jambi, but if it is anything like Qt in C++ or PyQt, the QWebView would resize automatically as the window size changes. As far as I know, setting size policies/ expansion factors, adding QSpacerItem objects etc. is only necessary if the sizing behavior is not working right. Just laying it out using an appropriate layout within the preview window should be sufficient. Do let me know if I have misunderstood the question.
You need to place the QWebView in a layout, that it will follow the change in its "container". For using layout with Qt Designer, refer to http://doc.trolltech.com/4.5/designer-layouts.html
From Qt Designer docs:
The form's top level layout can be set by clearing the selection
(click the left mouse button on the form itself) and applying a
layout. A top level layout is necessary to ensure that your widgets
will re-size correctly when its window is re-sized.