This should hopefully be a very easy question.
Within Netbeans, using the GUI Swing editor I have four panels within a JTabbedPane.
Tab #4 I want to sit where Tab #1 is now, but I created it last so by default its at the end of the list.
How to I move it in the GUI in Netbeans?
Google has not been my friend on this one. I keep coming up with questions about tab order, (e.g. Tabbing through forms), rather than what I actually want.
Right Click on the JTabbedPane->Change Order->You will get option to Move Up and Move Down which will change the order of tabs.
Select your JFrame or JPanel or etc and then jTextField or jButton or etc of the selected JFrame and go to properties of the JField or JButton and enable the "focusCycleRoot" (this JField or JButton will be selected first in the jFrame or JPanel ) then select the "change order" of the JFrame or JPanel in the Navigator window and "Move up" or "Move down" to change the order.!
I couldn't figure out how to do it in the GUI, but I hacked the .form file while Netbeans was closed and was able to move it. As a result, that works for me.
Open the Navigator tab in the Netbeans IDE (Window > Navigator). You can expand the JTabbedPane node to show a list of the JPanels representing its tabs. Simply drag one JPanel node to another position in the list and the tabs will be re-ordered in the JTabbedPane design.
Related
At risk of this being a trivial question, I need to know how to add more components (in the components explorer) in WindowBuilder for Eclipse Juno. I'm taking a dive and trying learn how to add a GUI to one of my personal projects. Right now all I have mustered up is just a JFrame that has a button that launches my program in the console with a little notification saying so. But what I am thinking about having is a "Start up Window" with just some stuff and button or something that says Enter application or something. So then I want a new window to pop up as a "Run Window". I have created a new JFrame as a "run window" and hide/set visibility of "startWindow" to false and get the result I want. But I want to be able to edit this new JFrame in the design window along with the default JFrame I started with.
Is there a way to do this? I tried right-clicking in the components window in the design view and it doesn't do anything. I also tried right-click the object from the project explorer and couldn't find anything. Am I missing something? Is this even possible?
The question seems to have 2 parts, so I will try to answer both of them.
1) Adding components directly in the components explorer
The only thing you could do, to get new components into there via right-click is "Surround with". For example you have a JPanel, right-click on it and click "Surround with...". You could try and put a JScrollPanel in there, so you can scroll your JPanel.
But the usual way to add components is by the "Palette", it contains a lot of components, that you can drag&drop into either the components-explorer or directly into your app Window -> Show View -> Palette.
2) Showing a certain window
If I understand this correctly, you want to show one window, click on a button and then show another window which has the same size etc. like the one before.
Setting the visibility for the first window to false and the second does work.
But under certain circumstances it's easier to use CardLayout.
Imagine a stack of cards, you can see only the first card. Then you click a button and now see the second card and so on.
See this: https://docs.oracle.com/javase/tutorial/uiswing/layout/card.html
for information and examples.
I defined several commands in my Application Model, say like openCommand, saveCommand. And I can add them to the menu bar or tool bar easily. Now I want them to also appear in the context menu of the edit part, how can this be done?
To be short, I want a menu item in main menu, a tool bar item in tool bar and another menu item in context menu. All these three items have the same function and thus should be mapped to the same command. I can do the first two but have no idea about the third.
Any help would be appreciated! Thanks a lot!
You define the context menu for a Part in the Menu section of the Part Descriptor in the application model. Add a 'Popup Menu' and give it a unique id. Add menu items to the popup menu in the normal way.
Tell Eclipse the menu is the context menu for a control using the EMenuService:
#Inject
private EMenuService menuService;
...
menuService.registerContextMenu(control, "menu id");
In Eclipse, I can undock a panel and move it to my other monitor (making it easy to compare two pages at the same time. However, in Aptana, I can split the window's, but it won't let me pull the panel out to my other monitor. Is there a plugin I can install that will allow me to do this?
Update
I have Aptana 3.3.1, and I can detach a panel just fine (the console panel for example), but I want to be able to take a file that is in the editor, and move it to my other screen.
Click Window -> new Window.
You can then close all the unneeded panels in the new window, drag it over to the second screen and drop in your editor(s) there.
Hope that helps!
What version of Aptana are you using? In my 3.3.1, I can detach a panel and drag it to my second screen by right clicking on the panel name and choosing 'Detached' or by just dragging it away from the main window.
What menu is called by Alt+Shift+S combination in Eclipse? How to call it from main menu? It is mostly resembles Source menu but has some differences.
Source menu
Source menu looks same but not exactly:
It is Source menu. If you do a right click in java editor you can see key combination for it and if you hover over Source you can see it is the same.
About the visual difference: If it is invoked from the main menu, disabled menu items stay visible (but grayed), because you would be very confused if the vertical position of the same menu item changed all the time (depending on how many other menu items above are disabled).
Context menus on the other hand are invoked at arbitrary places of your screen, so you don't notice a certain menu item offset "jumping" relative to the complete context menu. That's why many menu items are not just disabled in the context menu, but set to invisible.
That's the Source menu, Alt + Uppercase S
It's very simple to drag an editor tab to create a split editor layout (2 editors side by side).
For example this may produce the following layout where | indicates the window vertical split to produce two horizontally adjacent editors:
[TabL1] [TabL2] [TabL3] | [TabR1]
Having done this once, I cannot drag a second TabL to sit next to a TabR. The only options that appear on hovering the TabL over the right editor region are for further splits, or to detach the tab entirely to reside in its own window.
The same problem arises when attempting to drag a detached tab (in its own window) into either editor region.
Could someone please indicate how to achieve the desired result?
Sincere thanks.
To drop a view/editor into an existing stack you need to hover on the tab strip adjacent to the existing tab where you want the new tab placed. You will see a short vertical drop feedback line next to an existing tab.