Scrollable windows - java

I want scrollable panes.
Please, have a look at the picture
As you can see at the Navigator, I used Tabbed Pane, then placed Scroll Panes on it. Then placed Panel on it. And then added Lables. Looks like I'm trying to reach my left ear with my right foot. But without the jPanel1 my lable occupied the whole panel size.
Well now my scrollable panel doesn't work well.
It is visible at this .
Well, I made the window narrow. But the scroll bar at the bottom doesn't allow me to reach what is behind the border further on the right. And this scrollbar seems strange. It has only t left arrow. No right one. And no vertical scroll bar if I make the window less high.
Could you give me a hint how to make scrollable windows?

I'm not sure what you're doing wrong this is the results I get when I do only this and nothing more.
Drag and drop a tabbed pane to the frame
Drag and drop a scroll pane to the tabbed pane
Drag and drop a panel to the scroll pane
Drag and drop a label to the panel, and another label to the bottom.
Resize to smaller frame and scroll bars appear
Navigator Window

Related

JTree vertical scrollbars not working

I have a JTree embedded in a JScrollPane. When the JTree grows bigger than the display can show, the remainder of the tree is located at the bottom outside of the visible range. I expected the JScrollPane to start displaying vertical scrollbars if this happens so that you can scroll the remainder into view. The vertical scrollbars do not appear at all if the JTree is expanded and doesn't fit. Here is how it looks like:
I have both, the horizontal and vertical scrollbarPolicy set to as needed. I also tried embedding the JScrollPane containing the JTree into a JPanel but it didn't help. I'm using the UI designer in IntelliJ IDEA to build the GUI by the way.
Any help on making the vertical scrollbars behave as expected? Forcing them to be shown at all times also doesn't work: They cannot be dragged down regardless.
not use preferredSize.
in UI designer choos JTree element, find property preferredSize and in context menu select Restore default value

How to fix a panel of a splitPanel?

I would like to know how to fix the JPanel2(in my imported image) to the right side of the application. I am using a JSplitPane so I can resize my JPanel2 with the splitter. When I resize the window, I want the JPanel2 to keep the same size as I set before and the JPanel1 to stretch. For example:
Does anyone have an idea ? Thx.
From what I understand, you want to adjust the size of the left panel only on window resize. You might also want to anchor the jSplitPanel to the window size.
To anchor the jSplitPanel to the window size, left click on the jSplitPanel, go to Auto Resizing and check Horizontal and Vertical.
To adjust the size of the left panel only, you want to add
jSplitPanel.setResizeWeight(0);
In the window init().

JTabbedPane Forced Size

I have a JFrame that has 3 components on it.
The design is like this:
My problem happens in the JTabbedPane.
The pane begins off with a settings panel, which is added to it when the whole JFrame loads up. Then, when the user connects, a new tab is added to the pane (the actual chat panel).
When that tab is added to the pane, it overlaps the bottom of the java applet loaded from the local file, which is NOT what I want to do. Here is how it looks:
As you can tell, the bottom of the highscores and java applet has been cut off. How do I resize the JTabbedPane to make it resize towards the bottom, instead of upwards?
Call pack() after adding a tab to the pane.

java panel layout dock

I'm having problem with the "dock" in java panel. I have UI like
the panel has a slide bar, a button and a scroll view, i.e. the while area above, with GirdBagLayout, (I also tried BorderLayout but won't work either). below it is another panel, both panel are placed in a parent panel with GridBagLayout.
When I click the "more" button, I want to extend the height of the panel to 3*original height to let the scrollview show more stuff vertically. and of course I want the slide bar and button still at the bottom of the panel. I call resize on the panel but I got this:
it shows that the scrollview is longer than before but was cut, and the bar and button remain at the same place. and my question is how I can put the slide bar and button always at the botton of the panel and show the scrollview correctly.
well, answer to my own question:
have to set up the layout again and call revalidate() and repaint().

GWT: Draggable Popup with Scrollpanel

Designed a popup which is draggable, works as designed. Now Popup panel contains the ScrollPanel it is having vertical scroll bars, but while trying to scroll with dragging is not working
The following link gives u a window box implementation which is draggable. You can add scroll panel to it. I have tried it. It works. Have a look at it.
http://svn.clazzes.org/svn/gwt/branches/gwt-extras-0.1-branch/src/main/java/org/clazzes/gwt/extras/dialog/WindowBox.java

Categories