I'm trying to create a notifications system.
I'm trying to make a JDialog thats moves from outside the screen to a specific position. I'm using timing framework and I can move the dialog from a position to another, but when I try to specify a position outside the screen the dialog does not do that.
This code:
dialog.setLocation(new Point(-dialog.getWidth(), 10));
Should put the dialog on the right side outside the screen but it does not.
I did try to use some notifications libraries as:
JCommunique
jtelegraph
twinkle
jcarrierpigeon
But any of those libraries work properly for my needs.
Related
I am creating a panel showing many different kind of widgets such as button. The panel allows to zoom in and zoom out. It is required to show whole panel in the beginning. However, some users may touch more than one button when the panel is too small.
I want to handler the situation like chrome in Android. When the user touches more than one link, a pop up panel will be showing.
What library or APIs may I use?
Thanks!
You could place your Buttons in a FocusPanel implementing a ClickHandler to open your desired popup- thus when your user clicked between two buttons the click is registered and you can handle it.
Note, you will have to place a FlowPanel in that FocusPanel to place more than one button inside.
If you want to react on hover instead of on click, use HoverHandler instead.
I need your help with my application.
I'm writing a program that displays big images in tiles, using the SWT MapWidget (http://mappanel.sourceforge.net/swt/).
The user has the ability to place markers on the map, when he pressed the mouse for a couple seconds. Additionally, I also need a little ZoomBox next to the cursor that shows the area around the cursor, so that the user has better precision when placing a marker. This ZoomBox is to be displayed while the user keeps the mouse pressed. Placing the markers ia already working fine.
I have problems with implementing the ZoomBox, specifically displaying it. I found a post that does just what I need (Zoom box for area around mouse location on screen). The problem is, this post is for Swing and not for SWT.
I have already built a SWT_AWT-Bridge, so I have the ZoomPanel already in my shell. What I need is the functionality of displaying it on top of the MapWidget, while the user keeps the mouse pressed.
I figured, I need to use a StackLayout, but I don't know how.
EDIT
To clarify, my question is, how can I display the composite containing my ZoomBox on top of my image, while the user keeps the mouse pressed?
I am trying to implement expand functionality like in below example, however instead of a menu I am using a JFrame which contains more sophisticated GUI elements.
The problem I run into is that if I move the parent window which contains the button below which the frame should appear, I can not adjust my custom JFrame to open each time relative to the position of that button
initially I simply used
myCustomFrame.setLocation(myButton.getX(), (myButton.getY() + 73));
but this obviously doesn't work if I change move the parent window
After that I tried
myCustomFrame.setLocationRelativeTo(myButton);
but in this case it appears at the top of the button... I adjust the position for a particular case, but this is not a solution.
So I am trying to get the same behavior as menus have, such that the position of the JFrame is automatically adjusted.
Does anyone have any suggestions?
Have you considered using myButton.getLocationOnScreen()? That way no matter where you move the jFrame containing the button you will always get the Point of your button measured from the top left corner of the screen.
You could alter your original method something like this:
myCustomFrame.setLocation(myButton.getLocationOnScreen().x, (myButton.getLocationOnScreen().y + 73));
I've got an app that should show the Android ProgressBar circle when it is processing some input. Right now I just make it invisible when it isn't busy, but I'd like it to still show a motionless progress circle when not busy.
How do I get the Android ProgressBar circle to stop moving but still be visible?
I don't think there is a means within the APIs to make it not move. My guess is that you'd have to "fake" it by grabbing your own copy of the drawables that make up the progress circles and display one of them in an ImageView.
I have been playing around with trying to get a menu screen for my game. I have only been able to figure out how to paint a new Screen on top of an existing one; meaning that the actual game is still running behind the title screen. I don't need actual code but just a description of how I would go about this.
One way to display a menu would by by using a JDialog outside of your main application window. Take a look at the How to Make Dialogs tutorial for more information.
Another possibility would be to use JInternalFrame for your game and menu so they can be wrapped in a larger application frame. These are explained nicely in How to Use Internal Frames