Horizontal Scrolling in Swing - java

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.

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.

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

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.

Netbeans Swing UI designer - what does the hazard icon mean?

I'm working in the Design view of a Swing application and occassionally I see a small hazard warning symbol appear in the top corner of a component.
I assumed this was something to do with visibility overlap or similar but having adjusted things I can't match a guess against anything credible. Unfortunately it doesn't have a tool-tip and does not react to any mouse clicks.
Any ideas? Google does not seem to suggest anything either.
The NetBeans help topic, Java File and Object Node Icons, may help identify the icon in question. Tool tips on each icon indicate the relevant name. The one labeled error badge, for example, means "The file cannot be parsed."
It's a "free design" layout warning -- you put new component to panel/container without layout manager and need manually drag and resize it (e.g. attach it to container borders).

Why does my swing GUI look different in design than at run-time?

When I design my GUI using swing, the Swing Control Buttons are grey and the text easily fits on them. However, when I run the program the buttons become partly blue and the text no longer fits on them. Why does my program look different in the Swing Design than at run-time?
Why does my program look different in the Swing Design than at run-time?
Probably has something to do with your Look and Feel.
However, when I run the program the buttons become partly blue and the text no longer fits on them.
Probably because you are not using layout managers. Layout managers will make sure components are displayed properlly, even when switching between LAF's.
I can't guess what tool you are using to create your GUI but you are doing something wrong with the tool. If you need more help then post your SSCCE that demonstrates the problem.
I suppose you're using some GUI builder. Netbeans gui builder displays preview with native LaF, while program runs with default Metal LaF, which has different margins for components and font size. Either change LaF in your program to the one that works best for your layout, or make your components larger.

Java UI designer + framework similar to visual studio (drag and drop, floating controls)

I'm looking for a Java UI designer allowing me to drag and drop controls directly to the design surface in a floating mode (without the hassle of north, south etc that comes with SWT). Is there any such tool?
Also, I'm only interested in tools offering a trial version.
EDIT: I'm only interested in solutions allowing me to drag/drop items regardless of panels margin, LayoutManager stuff etc. The position should preferably be just relative to the window margin.
Thanks in advance
You can use NetBeans to design your GUI. Instead of messing with Layout Managers, just use the "Absolute" layout. It will put the UI Components exactly where you drop them, pixel for pixel.
Eclipse has a free visual editor called VEP. See http://www.eclipse.org/vep/
Instantiations has a very nice set of tools with a trial version:
http://instantiations.com
Note that for any visual designer, you should know how layout managers work to use them properly (and make sure your UI expands/contracts/adapts to font/locale properly). If you just use absolute placement, things can get cropped, for example.
See http://developer.java.sun.com/developer/onlineTraining/GUI/AWTLayoutMgr/ for my article on layout management to get a feel for how to use things like North, South. It only covers the original five Java layout managers, but describes why you need them and how you can nest them.
I recommend JFormDesigner, which has support for "Free Design". From
http://www.jformdesigner.com/doc/help/layouts/grouplayout.html:
The goal of the group layout manager
is to make it easy to create
professional cross platform layouts.
It is designed for GUI builders, such
as JFormDesigner, to use the "Free
Design" paradigm. You can lay out your
forms by simply placing components
where you want them. Visual guidelines
suggest optimal spacing, alignment and
resizing of components.
It has a trial version and is very easy to use.
Netbeans has a drag and drop module called Matisse: http://www.netbeans.org/kb/articles/matisse.html

Categories

Resources