I have a question regarding JScrollPane.
I am making a java app in NetBeans with swing and I am using few Jlists. Two of them, have many items and a scrollbar appears to the right side.
When I edit the app the scrollbar looks the way I want, however when I run the app the design changes. The image in the link below shows what I mean.
How can I use the scrollbar design of netbeans look when I run the app?
scrollbar image
Thank you in advance!
You need to set a look and feel.
https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
Related
I'm currently learning IntelliJ's GUI designer but I'm struggling to find documentation or any guides. So far I have watch a fantastic introductory youtube series from a guy called Scott Couprie, which I really recommend to any complete beginners reading this.
I would like to do three things. If anybody has a link to documentation or guides that'd be great.
Change the window title bar text.
EDIT: I have now discovered this can be changed with setTitle("Title").
Change the system menu icon. I am using MacOS so I don't even see an icon in the preview, so I'm not even sure where the icon goes.
EDIT: while I can't confirm this is working due to using MacOS, I see that you can use the following in the constructor:
ImageIcon img = new ImageIcon("images/16x16.png");
setIconImage(img.getImage());
Be able to click a button and go to another form. So far I have been able to switch panels after pressing a button, but only to other panels within the same form itself.
Thanks.
I have tried searching for related documentation or youtube videos but I'm not sure what terms to search.
This can be changed with:
setTitle("Whatever you want the title to say");
I am playing with the TightVNC viewer for Java and can't find the way to embed the VNC screen (Viewer) into my JFrame window. I do not want a separate window. In fact I do not want any of those (useful, but sometimes not required) buttons.
Simply put, I want to have a JFrame with VNC viewer taking the whole window, and all other stuff from the TightVNC viewer hidden.
Any ideas how to achieve this will be greatly appreciated.
TigerVNC and TightVNC are almost the same (1st depends on the 2nd), but TigerVNC is organized a bit different. Because I don't think it would add up explaining everything for TightVNC in detail I'd suggest using TigerVNC instead, if it is possible license-wise ... maybe your problem doesn't exist there. The steps are the same (trace through the code or something... to find the places where the viewport is assembled) for all Java GUI applications, just the classes have other names.
In my Android application, I have a ScrollView. This view includes more than what screen can show. To see the rest, I need to scroll down. But, in android GUI Designer, I am unable to scrollDown the ScrollView, because I can't see any option to do that.
I found this answer but I can't find the Clipping option they have mentioned. So, how can I scroll in Android GUI designer and design the rest of my application? I am using Eclipse Juno.
That sounds like something that needs to be checked in the emulator or on a phone. The GUI designer is not meant to be interactive or the end-all-be-all. It's supposed to give you a general idea of what it's going to look like live.
I would like to create extend a Java Swing application to have a look somewhat similar to an IDE such as Eclipse or Visual Studio. That’s, there would be a panel at the left that displays a tree, and a tab panel on the right that allows several elements of the tree to be opened and edited on right. For this I could easily use a BorderLayout and just use the center and left areas.
However, I would also like to have the ability for the user to drag the border between these two panels, just like Eclipse and Visual Studio allow. I can think of several ways to do this, but was curious if anyone had found a particularly good way to do this, or knew of an example. I’ve googled for it, but have not found anything.
You could use JSplitPane. And maybe have a look at an article about a MultiSplitPane.
While JSplitPane does exactly what you asked for, you might also be interested in JToolBar, which does other Eclipse-like things such as attach/detach and drag a panel of tools around the UI.
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.