What Swing control to use to choose from "big data"? - java

I would like to ask what swing control to use in case below.
I am working on some school project and developing application for digital evolution. There will be big number of processes and I would like to chose only single one. For this one I will draw a graph.
I think JComboBox is not the good solution, because there could be many processes (like hundreds). What is the best way for this selection?

Go for Paging or pagable JTable(Table) Model for large data set
JScrollPane will help you out for scrolling around records
Here is a tutorial about how to achieve it

Related

How to toggle different forms in NetBeans GUI design

I'm using NetBeans 8 IDE to design a desktop application. How can I transit among different forms (e.g. login page and homepage)? Should I design multiple .java JForms or is it possible to completely delete previous components and bring new ones?
Is there something like hidden tabs that aren't shown to the user but really exist? I am looking for a high performance way to toggle forms.
Were you to have the form constructed programmatically - although this is a bit inefficient - you could use a switch statement in a loop with cases that contain the individual forms, and statements to clear the existing form components. There's also an easy JavaFX navigation solution using a larger-than-viewport area (containing each form in a horizontal series) wherein the forms get the viewport one-by-one, but it looks like you're using swing; sorry if it's of no help in this case.

Need help setting up GUI featuring grid and clickable items

For my Comp Sci assignment, I have to make a world that has Village objects connected via Roads in a graph data structure.Gnomes, each running their own thread traverse this world from one village to another using the shortest path. This whole thing needs to have a GUI, however.
Basically I need to have a grid with the villages on the intersections. Something like this ( without the numbers):
(source: kwiznet.com)
The villages have to be interconnected with roads. If it is not too difficult, roads should be deletable if they are not the only road connecting the village to the rest of the graph. This would be done via clicking.
There must also be an option to add villages by clicking on the graph, and select current villages, deleting them.
Basically:
Graph data structure is translated to GUI grid
Roads and Villages can be selected
Selected items can be deleted
Could you please just point me to what I need to research as I am new to GUIs? Such as the best layout manager, in what way to handle action events, how to draw a grid, etc. I just need a brief outline.
This is a HUGE question, although that's not really your fault. Here goes:
Read through the Java Swing Tutorial.
Learn a bit about MVC. Link1 Link2
Understand that Swing is not thread safe.
Then:
The best layout manager for your graph is likely the grid layout.
Probably you should add a JButton to each node so you can just click on it. JButtons can be made to look like anything so don't be put off by how they look by default.
Then MOST IMPORTANT: probably you should use a GUI Builder tool of some sort. I recommend NetBeans Matisse if you are new.
Now you should try all of that, and ask a SPECIFIC QUESTION when you get stuck. Good luck!

Java Swing: flyweight vs new windows

I'm developing a new application where I'll have some windows opened at the same time.
I'm currently trying to design the GUI and I'm struggling with two choices:
I could use a side navigation panel and using the center of the page to display the content of each panel. These panels would be stored according flyweight pattern and I would just hide/show them when navigation buttons are clicked (in order to save the content as is was when hidden, for example a user registration form).
I could use a front page displaying the menu all over it and use popups/new windows to show the content. These could be closed/minimized etc).
My problem is: What if all the panels are stored in my flyweight pattern? will it have a huge performance hit or will it still run smoothly with like 15 JPanels stored? (of course those JPanels will have sometimes lots of content in it such as forms etc).
What do you think would be the best easy-to-use/performance choice ?
Thank you :)
JTable rendering already uses the flyweight pattern, so a one column table is ideal for selection. A custom renderer can display an arbitrary thumbnail representation, while a ListSelectionListener can display arbitrary detail in an adjacent container. In the TableModel, consider an LRU cache if the individual data records are consuming too much memory.
As always with performance questions, prototype and profile.
As long as you don't attempt to hold more data than fits the heap reasonably, performance will be a non-issue nowadays (unless you do something exceptionally bad you will not notice any performance difference from the user perspective).
That said, unless you have pressing reason to hold on to GUI's you currently don't need - just let them get GC'd and recreate them as needed. The create-throw-away after one use approach is more flexible when the application needs to be modified and bears less opportunities for memory leaks.
As for the GUI design aspect, many people absolutely hate popups. They can also interfere with focus management/keyboard usage. But it still depends on which kind of control flow you need. Side menu bar is fine for many purposes.
I'd like to point out that the side menu is just a fancy reinvention of Tabbed Pane (which is a standard component you wouldn't need to implement yourself). Also, if things need to be done in a specific order - a Wizard like approach can also be a good choice (one Window that changes contents with each step completed).

How to make iGoogle like UI using java swing

I am developing desktop GUI application using java swing. And I want to show several "subwindow" on the same window(JFrame). And I want the layout is similar to iGoogle such that user can add and remove new subwindow. To be simple, I assume all the "subwindows" have the same size and similar content(all are showing chart). By the way, the maximum number of "subwindow" would not be a huge number. I think it is less than 8.
if there is no drag and drop, can I just use grid layout to
implement it?
if there is drag and drop, what is the easy way to
do it?
Thank You very much.
FYI: iGoogle http://www.google.com.hk/ig
I don't know what iGoogle is, but it sounds like you should be using internal frames. See the section from the Swing tutorial on How to Use Internal Frames.
If all the "sub windows" will be equal size and not draggable, I'd just use a simple layout. seems like a good case to use TableLayout. In a simple case where you know the max amount of slots, you could have 8 corresponding JPanels and add them to Container using the table layout (making sure to revalidate()) as the user requests them. if a user closes one, you just remove it from the container and revalidate. Hope that helps. if you don't need docking functionality, don't even go down that road is my advice.
EDIT:
you could also still implement drag and drop by using your own mouse handlers.

How to make an Advanced user interface in Android?

i wonder how you can make an advanced Android User interface where you can add for example a drag drop and more graphics options? is that by using OpenGl ?!
this is example of UI in iPhone Apps.
example 1
example 2
Thanks
Your examples just seem to be composed of a lot of nice images. Your first example looks pretty static and could probably be made from buttons with custom images and setting lots of backgrounds on your layout items. The second looks like you would need to make a custom Gallery and do a little more manipulation and composition of images so it might be worth your time to go a little lower level for performance.
Basically, you're looking at using a lot of images. You can make them work with existing widgets and components and get the functionality more easily, or you can use OpenGL ect. To get some more flexibility and performance at the cost of having to code all the functionality in yourself.
If you're looking at drag and drop this post points to the source for a ListView with some rudimentary drag and drop functionality.

Categories