How can I make a Wicket modal window un-draggable? - java

I am using a Wicket modal window in my application. Is there any way to make it un-draggable? Any information will be very helpful to me. Thank you.

Unfortunately, there is no support for this, at least out of the box. It is possible to prevent the user from resizing the window, but draggability is not affected by that.
Full Javadoc for ModalWindow in version 1.4.7 is here.

As explained by Lord Torgamus, the standard ModalWindow can not be made un-draggable.
As an alternative, however, you could use the wiquery dialog. It offers the same confiuration options as the JQuery UI Dialog. Among other things, you can control draggability.

Related

Wicket 1.5 Non modal window

I need to create a non-modal popup dialog, which can be dragged and resized by the user.
This example is great, but is a modal dialog. I don't want to block the user from scrolling the main web page.
Is there any component built in to Wicket that I can use, or do I need to use a Javascript library such as YUI or Dojo?
I'm going to use jQwicket for this, which is a JQuery/Wicket integration library
It has a load of useful components, but the one I can use for this particular case is the DialogWebMarkupContainer component.
JQwicket gives me a fairly painless way of using Javascript, using the Java I know and love. That's as it should be :-)
I'm not entirely sure if I understand your concern with "blocking the user from scrolling the main web page" correctly, but maybe you should look into WiQuery - escpecially this example. These dialogs still let you interact with the underlying page.

Can a JavaFX 2 applet request focus and so focus on browser / tab?

I'm wondering if there would be any solution to show and focus on browser's tab containing a javafx 2 applet programmatically from the applet.
I don't think there's a simple solution, but who knows :)
PS : Obviously, stage.requestFocus() and stage.toFront() don't work.
No, there's absolutely no way to do this using no custom native bridge doing the job, even with a javascript bridge.
With the next versions of JavaFX neither.
And applets are not supported anymore in Chrome, so I think nobody would try that anymore.

SWT listener for JavaScript window.resizeTo?

I'm working on an application that uses the SWT Browser widget to display an HTML page with some JavaScript in it. The JavaScript tries to use window.resizeTo to change the size of the window, but it currently isn't having any effect.
I've fiddled with the browser settings, and it doesn't seem to be an issue with the underlying browser; switching between Mozilla and Internet Explorer rendering engines has no effect. I suspect that SWT simply doesn't automatically re-size the window in response to JavaScript functions.
I can easily re-size the window from my Java code, but I need to know when to re-size it, and how big JavaScript wants it to be. Does SWT provide a way to listen for this? If so, how?
I still don't know of any way to get this information, but a work-around is to change SWT versions. Some of them implement JavaScript's window.resizeTo automatically, and some of them do not.

Equivalent to Android's Toast or Mac OSX Growl in Java Swing?

Looking for a means of displaying transient, non-modal dialogs in a Swing application. In other words, I'd like to pop up a semi-transparent box with some text in it that can be immediately dismissed, or will fade away in a set amount of time. Is there a library to do this? I don't want to reinvent the wheel if it already exists.
Growl screenshot:
Android Toast screenshot:
(source: devx.com)
This link provides information about "translucent shaped Windows" using Swing, though it does not provide the full sourcecode (but slides explaining what has to be done in order to achieve this). He basically uses JNA to avoid problems with repainting translucent windows and makes use of two libraries to easily add fade etc. support.

Recommended technology choice for desktop application

I am creating an application that is essentially a financial alerts site. I am a basic level Java programmer, and I have created some of the logic for alerts in Java.
I want to be able to have pop-ups appear on the desktop whenever something "interesting" happens (interesting depends on %change, liquidity and a few other simple factors).
What is the best combo of technology to implement something like this?
I would use the java.awt.SystemTray in Java SE 6. It's cross-platform and pretty easy to use.
Although some people hate the balloon notifications in Windows, they're the least obtrusive popups, since they can be ignored by the user or easily dismissed. Most importantly, they can't be missed by the user who has been away from the computer, because balloons (at least in Windows XP/Vista) use system idle timers to determine when's the right time to disappear.
Some prefer more traditional toast notifications, similar to those shown by Outlook - they show up and slowly fade out, giving the user some time to interact with them if needed.
I had the same problem and finally solved it using an undecorated, alwaysOnTop window.
And thanks to this blog entry I found the TimingFramework, and now it even is translucent, fades in and out, goes 100% opaque on mouse over etc. In conjunction with the SystemTray and TrayIcon the behavior is nearly as that of Outlook.
Oh, I have to note, that other than the second link, I do the fading out with
AWTUtilities.setWindowOpacity(window, op);
You could write a java program that resides in the system tray, but I am not sure if there are cross platform compatible ways to do this. maybe you have to use a platform specific library for Win, Mac, Linux, ...
I'd just create a message window and animate it. Then add SystemTray support and voila, you're done.
In Delphi you can do that pretty quickly, but you can't easily reuse your java logic
You can just run you program in "silent" mode, without creating any windows by default, maybe just a little icon in the taskbar which when double-clicked will open a settings window. The program will be running in the background and creating windows with the set focus whenever an event happens.
But in my opinion, a slide window or at least a balloon tooltip is a better idea.

Categories