how to manage viewing of top components in java swing [closed] - java

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
enter image description here
I want to switch between top components taps using code without need to click the tab
I have three top components, two of them are "editor" top component
an the third is explorer top component
when I do some thing in the third i want to control which of the two "editor" be viewed (selected)
I'm using Netbeans Platform.

For JTabbedPane you can switch tabs by calling setSeldctedTab()
See the Javadoc

So, based on the selected element in your "explorer" component you could use a CardLayout to switch the view (to the correct editor).
See How to Use CardLayout for more details

Related

Is it possible to put a button in a NatTable? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 1 year ago.
Improve this question
enter image description here
Is it possible to put a button in the table like the attached image?
NatTable is a custom painted table control. Putting real buttons in the table is possible, but actually does not really make sense and could even lead to resource issues in larger tables.
You can actually render anything if you have a corresponding painter. And for a button you of course also need the action binding. NatTable has the ButtonCellPainter to render a cell as a button. But actually the implementation to mimik the button press is a bit outdated IMHO. The corresponding example should give you an idea what you can do and how to do it.
https://git.eclipse.org/c/nattable/org.eclipse.nebula.widgets.nattable.git/tree/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/examples/_102_Configuration/Rendering_cells_as_a_link_and_button.java

Object scaling (resize image, button, text and panel) in Java Netbeans [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I'm using Java Netbeans to develop my display software like this: original display, but when i set fullscreen display to: maximize display that's object content (picture, text, button, panel, etc.) size didn't change.
I've found the methode to image scaling, but it's manually that's object (not all of the object in entire JFrame). There is any easier way to change all of my object content to resize automatically in Java Neatbeans?
Thanks...

JPopupMenu arrows for up and down when showing a lot of information [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am using JPopup menu to implement an autocomplete model in java. everything works fine but the problem is when showing a lot of data that could be irritating. How could I implement arrows for up and down and limit the number of items to let's say to 5?
Is there any better approach for autocomplete model?
You essentially want what a JComboBox does. See BasicComboPopup What you would basically do is wrap your popup in a JScrollPane
Check out Darryl's Menu Scroller.
It has a few features you can customize:
the number of items to display
fixed items at the top/bottom
scrolling speed

Move images on JPanel in Java [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm trying to place some images on a JPanel and make them "relocatable" so I can click on one of the images and move to somewhere else on the JPanel while holding the button. It works fine with one image but I just can't come up with a solution for more images than one. I have checked many examples and tried many different ways. If you have any idea please share with me. Thanks!
It works fine with one image but I just can't come up with a solution for more images than one.
You can use the Component Mover. You register the component with the class and then you can move any component.
Or if you don't need the full features of the ComponentMover class you can just use the basic listener for dragging a component.

Adding a window to another window internally [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I was wondering is it possible to add a window to another window? Like can you add that window, like an internal frame to another window. The reason why I am asking this is because I want the image window (which is produced by ImageJ) to be displayed in a desktop frame or window. Also how would you go about doing this. Thanks in advance.
You can call the getContentPane() method of a JFrame, or more generally the getComponents() method of Container (e.g., in the case of java.awt.Frame or java.awt.Dialog windows) and then set it as the content pane of a JInternalFrame.

Categories