how to autoset all the components of jFrame while maximizing it [duplicate] - java

I want to create UI for my program with netbeans but I don't know how to create a UI that when user change the size of program window( maximize or other sizes ) component of the program change sizes for match to that program size.
I want to create a GUI for aria2c download manager like Google Chrome that has one button to change state from HTTP to FTP or metalink and so on and a textField for import users download link and a button for settings like Google Chrome. Below this toolbar I want to show things that user want to download like IDM. That IDM show name and status of things that user want to download. Please suggest how I can create this GUI and which layout manager is comfortable for creating this GUI. Thanks very much.

You can use either GridLayout or BorderLayout. Also read this: Using Layout Manager

Agree 100% with Harry. Also:
Avoid using NetBeans default GroupLayout
Learn about nesting JPanels each with its own simple layout to in effect nest layout managers and create complex layouts.
Probably avoid usingGridBagLayout early on when learning to use layout managers and use the more simple ones if possible. Consider using MiGLayout if you need a complex gridbag-like layout and nesting of simple layouts doesn't solve the problem.
If stuck, post an image of your desired GUI layout and your latest code attempt, and we'll be able to give you more specific advice.

Related

Can't scale and move components in IntelliJ

I can't scale and move components in IntelliJ with its GridLayout. The problem is when I move/scale components they don't move to the exact place.
Picture (But I think you'd better check the vid out)
I uploaded a video on youtube
Here it is https://www.youtube.com/watch?time_continue=9&v=X6CF7TJ7GJg (sorry for a non-english speech)
You should learn how Java Swing Layouts work. Most layout managers do not allow you to place the components where you want (there is so called Null-layout, but it's not supported by IntelliJ IDEA).
You normally use splits, spacers and constraints to define where the components will appear and how they will resize when the form is resized.

Java File browser

I am in need of a java file system browser without all the buttons and fields. Does swing have any components that can do this ? If not are there any third party components that can help me with this ?
JFileChooser
What I am looking for
In hindsight the question is vague. The JList style view of the component is not exactly what I am looking for. I just need a file browser which will fire an event when user selects something. Whether it is a JList style browser or a tree style brower is secondary. I see there are ways I can code this myself, the reason for posting a question here is to see if there are components that do this already.
Pretty much yes, you can get the horizontal listing of the files. You will have to use the JList's horizontal wrap for layout orientation. More details about the same can be found here.
JFileChooser wont allow to hide the rest of the controls, as it will end up loosing the core functionality. You will have to make use of your own custom control using the link described above and do the file operations.

set layout to resize the control in java designed using netbeans

I am designing the swing JFrame form using NetBeans . I am not sure about the layout setting in JFrame form .When we change the resolution of the windows the forms are not adjusted automatically
but i want the forms and control designed on forms should be re
sized automatically. How is it possible
You can change the LayoutManager in by right clicking your panel. Look at this Layout Manager guide to find which suits best for your program.
Or: For the default NetBeans Layout Manager, you need to "anchor" the components for auto-resizing. And setting them resizable, too (but it is the default).
For any component that you want to add layout below images will guide you:
You need to choose layout that fit to your requirements.
Also you can customize the layout, to do that:
Also you can do it manualy or you can change the properties from Customize code.
To do that like the above image right click on the component and go to customie code(Cannot do it for JFrame).

Horizontal Scrolling in Swing

I am having some problems figuring out how to make the outlined red part in the screenshot below using Swing. It's a GUI issue. Specifically I'm doing a little project about TV Series and I don't know how to show the characters' name in a horizontal scrolling control.
Can anyone show me the extends JTabbedPane about my particular problem?
If I'm missing something please let me know.
Full screenshot: http://img138.imageshack.us/img138/5381/screenxk.png
You may be looking for JTabbedPane.SCROLL_TAB_LAYOUT, which provides platform-specific navigation controls:
If all the tabs do not fit within a single run the look and feel will provide a way to navigate to hidden tabs.
In contrast JTabbedPane.WRAP_TAB_LAYOUT provides a (default) wrapping policy:
The tab layout policy for wrapping tabs in multiple runs when all tabs will not fit within a single run.
See How to Use Tabbed Panes for examples.

Regarding swing containers

I was doing a research, I have the below application in that we have the following swing layout..
Now the thing is that this same ting I want to develop I was using swing designer of google framework ..
Please advise me what container layout and extras other things do I need t build this same forat through swing designer and I aslo later want to customize it.
As I understand, your problem is resizing two buttons equally? Well, I'd use Mig Layout, create two columns, that will scale 50% each.

Categories

Resources