We are using the OpenSwing Framework for our application and ran into a problem with the viewOpenedWindowIcons() method.
We have noticed that when we open more than 6 windows (depending on screen size), the "opened windows tab bar" does not display tabs for these additional windows.
Does anyone know if there is a scroll function that we can implement to have the ability create more than six tabs?
I never use swing and this framework more than 1 year. just some suggestion may help you...
change the look&feel to system default , may not have this problem.
please find org.openswing.swing.mdi.client.WinIconsPanel, which is a JPanel with FlowLayout(FlowLayout.LEFT).and you could make it scrollable with the scrollbar hidden,and add two arrow(left,right) button on the side of it.
Related
I know in java-fx to make the window transparent, you need to set the stage style as stage.initStyle(StageStyle.TRANSPARENT);. However this will also remove any stage decorations so this does not solve my problem.
The reason I need this is because my application will need to use stage.setAlwaysOnTop(); at certain points, but this feature is not well supported on the target system (centOS). The application also requires stage.setIconnified();, but this does not work if the stage is undecorated.
Any suggestions will be appreciated.
Thanks
The short answer would be "no, you can't" ... because the minimize/maximize/close buttons are part of the decoration. No decoration - no buttons. It would be a contradiction in itself.
If you need the functionality of those buttons, you would have to create your own buttons as a part of your UI and emulate the behaviour of the decoration buttons. That's what many apps do that come with no default decoration.
Anyway, if you want to manipulate the window behaviour in this way (stay-on-top/iconify, etc.) you always need to take the underlying operating system into account. Any apps (not only Java apps) are only allowed to interfere with window management as far as the OS windowing system allows them to do so.
For example, in various MS Windows versions, the OS behaviour changed several times at this point.
I was trying out example of how to create Menu using SWT. I am using Eclipse on Mac. I was referring to this example. Whenever I run this example, I have two problems:
The Menu doesn't show up until I make it full screen.
The Menu buttons are unresponsive i.e when I click on Help, it doesn't show up the dropdown containing Get Help.
Do I have to make some spwcific changes while creating Menus on Mac?
Probably 7 years too late, but if anybody finds this I had the same problem and I simply switch to another window and switch back to the display and it worked. I don't know why it works but it did it for me and I hope it will for you as well.
I installed the community edition of Intellij-IDEA 13 and I lost the tool window buttons on the right, left and bottom. Here's an image of the buttons on the right in Intellij-IDEA 12:
What happened to these? I can get them to pop up by going to View -> Tool Windows -> <Pick One>, but if I close them, I have to go back to the menu to get it to pop up. This isn't that big of a deal because there are also short cuts attached to some of them. But, I use the "Maven" one frequently, and there's no shortcut attached for that one.
Were these tool window buttons replaced with something better that I haven't discovered yet? If not, is there a way to get these buttons back?
Such buttons are invisible by default from left and right side. Click here if you want make them visible: And click again and they will disappear.
Maybe this will help:
http://www.jetbrains.com/idea/webhelp/intellij-idea-tool-windows.html
There's a button that will bring them right up without resorting to the menu selection.
Whilst the tool window buttons are not visible, you can double-tab alt to see them temporarily (the 3 borders containing them pop up), and whilst still holding down alt you can hit the relevant key (e.g. 1 for Project) to choose one.
Similarly, you can use ctrl-tab and a number to focus a tool window.
I commonly have tool windows visible on my desktop pc and not visible on my laptop (where screen space is limited).
I'm trying to create a java desktop application that holds desktop icons. The app will be a menu/panel that is invisible until you hover your cursor near the top of the screen, at which point the menu full of desktop icons will drop down. To add new icons to the menu one must simply drag icons from the desktop into the menu and they should snap to grid. As I am an intermediate level programmer but I havn't ever done a GUI app before in any language, I was wondering if someone could help me out, both with how to approach the problem and on the packages and methods I should be using. Also, I'm thinking of doing this with NetBeans unless you have any other suggestions.
Thanks,
Andrew
As an alternative to Chad's option, you could also do this by creating a frame and using Java's transparent window capability to make the frame transparent (or translucent, if you want a hint that it's there), and using mouse entered/exited events to return the frame to its normal "solid" opacity.
Personally I'd try this solution just because I'd rather use event-based notification than polling the mouse position, but I expect it's more work than the other alternative.
As to drag and drop, I haven't used it extensively enough in Java to give any solutions, but it's not immediately obvious (from a cursory internet search) of how to handle native desktop drag and drops. I'd suggest starting with some dnd tutorials within an application so that you really understand Java's drag and drop API and capabilities.
You can use java.awt.MouseInfo to get the location of the mouse at any point in time, even if you don't have any windows open.
So, you could start a java program, then in your main loop poll the mouse location. If it's in the 'top', then you can open a window.
You can use the easiest thing to do would be to use JButtons or JLabels with images to represent the desktop icons. Just load the image you want to use and stick that on as a label.
I'd start by going through swing tutorial and writing a few simple GUI programs to get the hang of it.
But the MouseInfo thing is what you need to tell when the mouse is at the top of the screen.
I'm creating a cross platform application using Swing and Netbeans (Group Layout). Is there a trick I am missing to help develop dialogs with say OK, Cancel buttons in the correct order for different platforms - specifically Windows (OK-Cancel) and Mac (Cancel-OK), rather like the JOptionPane does? I can derive my own class from JDialog with two buttons on it, and swap text and actions around - I just wondered if there is something 'out of the box' I've missed. (This is not a question about which way round buttons should be, or the use of verbs e.g. Save instead of Ok.)
MiGLayout supports this out of the box. Either use this layout manager, or look how it does its magic.
Eclipse SWT also provides platform-aware layouts.