Javascript PopUp Functionality - java

I spent hundreds of hours writing an HTML5 application.This application deals with multiple popups and I suddenly ran into a problem when managing them.
My main goal would be bring a blurred popup window to front by focusing it.I am wondering if this is possible in JavaScript.
If not, could I use java applet in order to gain more functionality on my popup windows. Could I perhaps embed Google V8’s engine in order to render my existing HTML5 code in this application?

when you open a window you create a reference to it. You can then use that reference to call focus() on.
var foo = window.open( /*params*/ );
foo.focus();

Related

Am I correct in assuming I can create a dynamic front end with Servlets and jsps that is rendered from the back end?

I am trying to build a simple click based game using Java EE. So LOTS/All of functionality is triggered by clicking buttons. Am I correct in assuming I can build this thing easily with only using servlets and jsps? So no javascript. Will Java EE give me all the same functionality that javascript could if I wanted to make a decoupled web app instead of my app being rendered totally from the backend?
Also I'm new to Java EE and want to make sure I'm approaching my problem correctly.
I've been trying to display a background image specific to each location in the game that renders when the user changes the location but this seems difficult to find out how to do.

libGDX as a "launcher" app

I have made a light weight java web-server serving html files and static content (made with pure java library nanohttpd), i have successfully made a javaFX launcher window that has a single button, clicking button simply runs the server in the background and opens the localhost URL in Android/PC browser (I was unsuccessful in making an IOS version using javaFX)
I am thinking of using libGDX as "launcher window" because of IOS support and access to mobile specific hardware like SMS/GPS which javaFX don't have.
I am targeting IOS/Android/PC, I'd like to ask libGDX developers how possible is this given my target platforms?
Yes you can
There's a catch though, you may have to build the UI the game dev way
I've made a game or two using it and had rather steep learning curve in the beginning to get a hold on to how it worked. For example you'll have to provide the images for button, background and also, the pressed view of the button... like that. But your app is not a game. So you won't have to worry that much.
Once you learned how to place them in the screen successfully, there is not much to worry about because the API provides everything you need to carry on from there.
Also I found enough resources/tutorials online enough to make a game from ground up. So you'll definitely can.
And there's very little to worry about your multi-platform problem.

Browser window control focus

I'm working on a web app that interfaces with TWAIN devices (document scanners). JavaScript sets a Java applet's boolean that triggers it to pull up the scanner interface. When the TWAIN interface is shown it is sometimes behind the browser window. It sounds like there's no way to set the TWAIN window visible, so instead I need to send the browser window backwards to be behind it. I have tried JavaScript window.blur() and also Java setVisible(false) in my applet and neither seem to work. Keep in mind I don't have any popup windows, the applet is embedded in the only browser window. I have read that JNI is capable of this but cannot find any examples. I am capable of using JNI because my applet is signed, although I'd prefer a JavaScript solution as it would be easier to implement.

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.

MDI with JavaFX or Swing

Back in my, ahem, Visual Basic programming days, I remember it was very easy to create a multi-form program.
In the gui designer I could simply create as many forms as I wanted and then load them in my program where needed.
I'm having a very difficult time doing this in Java.
I started out using the Java FX Scene Builder but soon discovered there doesn't seem to be good MDI support. So, back to Swing. But, again, I don't see a simple way to design a multi form application.
I read somewhere that JDesktopPane was the way to go as it will allow you to have different internal frames, but there is no way, that I can see, to design multiple frames in the NetBeans gui designer.
You would think that you could hide an internal frame in the designer so you can layout another frame. While I can add multiple frames to my JDesktopPane, they all overlap each other making it impossible to design multiple frames.
Are there any tools available to do what I'm trying to do, or do I just need to bite the bullet and code the guis without the help of a designer?
In brief, I just want to create a simple application that displays three or four options on a home screen
Enter new customer
Search for existing customer
Quick estimate
And depending on which the user selects, opens the appropriate form. It would seem that this would be a basic requirement for almost any program and I don't understand why it seems like actually creating an application with multiple windows/forms was never thought of when developing the design/development tools. Thoughts? Suggestions?
If you're really keen on using the multi document interface (MDI) of the JDesktopPane, create each form in it's own class form. Don't drag them to the desktop. This will allow you to isolate them.
(You can double click a internal frame and it should enter "isolation" mode, basically making it the only thing you can see)
However, unless the windows are sharing information (ie you want to see the information in one window to change the information in another), I'd avoid it.
A better solution might be to use a CardLayout which will allow you to switch between each form as you need.
Again, I'd start by building your forms from something like a JPanel, individually, and when you're ready, add them to your main form.
I always encourage people who are coming into Swing anew to hand code their forms, it will give you a great appreciation for how to design forms and the power of the layout managers.

Categories