Java place other windows app below of my swing application - java

I have a java swing application which is a ticker and it's on top of display. Now I need a way to place other windows applications when they are maximized to be below of my ticker. I mean I don't want my application to overlap other app' s toolbar.
Is there a way to implement such a functionality?
Something like in image, above is my ticker and a chrome can be maximized and the shouldn't overlap toolbar:
Thank you.

When you maximize an app, you are telling the window manager to "Set the size of this app to be the full size of the screen". Apparently you want that to be "Set the size of this app to be the full screen size, minus the size of my special app" - that is, place it just south of my special app. This is probably not possible without writing your own window manager.

Related

How to "fake" someone clicking the fullscreen button

I am making a javafx application and I made the border around it invisible but now I would like to know how to "fake" someone from clicking on the fullscreen button (in Windows the middle button in the right top corner). I know how to make it 100% fullscreen but I just want to know how to "fake" the clicking of the windows fullscreen button.
Thanks.
Solution
I think you refer to a maximize button, and perhaps the stage.setMaximized() method.
Maximized != Full Screen
Setting the stage fullscreen viastage.setFullScreen() is generally a different thing than maximizing a stage. A full screen stage operates in full screen exclusive mode (i.e. no windowing at all, the stage takes over the entire display).
Related
What you seem to be doing is creating an undecorated window (i.e. a window with no default OS window frame and no in-built controls for resizing, title and minimize/maximize/close), but you still want some of the functionality that you would get if the window were decorated (by adding your own custom decoration controls to provide it). For more information on how to tackle that problem, see the related question:
JavaFX entirely customized windows?
In particular, checkout the Undecorator project, which is the defacto standard way of supplying such functionality for JavaFX.

Set an icon similar to mac when minimized it to dock

Set an icon for a JFrame when it is minimized to the dock like other mac application.
Please help..
An e.g. of what Mikle was referring to:
Now moved to: Sizes of frame icons used in Swing.
Use the jar bundler that is available with Mac os to create an App. Set the icon of the app using jar bundler and dont set any icons for your jframe.
Window class has method setIconImages which requires java.util.List<? extends Image> as an argument. You will have to pass a list of images with different sizes so that OS can choose one from that list for each specific situation - would it be minimized icon, icon for dock/toolbar, icon for window or icon for any other system-specific UI element.
I usually pass a lot of images for my own application in different sizes:
16x16, 24x24, 32x32, 48x48, 64x64, 128x128, 256x256, 512x512
The large ones are usually used by large toolbars or by folder view to display icons for files associated with your application. Also usually 16x16 icon is used as window (frame/dialog) icon. Other icons can be used in a lot of different situations which depends on what OS you have (Windows, Mac OS e.t.c).
You're really talking about two things.
The icon of the application in the dock, in Finder, etc.
appbundler or even simply hand-creating the bundle is the solution to that, as already
mentioned.
The icon of the application when minimised to the dock
When you minimise the application it becomes a separate dock entry which does not
necessarily look like the application one.
The Window has setIconImages - if you set this method, the application will become
that icon when minimised which will not look native. So you should check if you're
running on OSX before calling that method and avoid calling it.
By leaving out the call, you get the default behaviour where the minimised icon will
be a miniature copy of what the window itself looks like, which is what we see
other applications doing. It would be nice if the JRE would take care of that for us
and just ignore the icons when running on Mac OS X.

Java Window in another Window

Multi-window applications often have a main-window, and all other windows are kind of 'parented' to it. Minimizing such a sub-window will hide its content and show the title-bar at the bottom-left of the screen. Also, these windows do not have their own Icon in the Task-bar, only the main-window does.
How can I make a window being attached this way to another window?
If that is possible, is it also possible without a referenfe to the actual main window?
#2: I'm embedding Java into such an application and I would like to be able to use awt or swing additionally to the native dialogs, which have this behavior by default.
See How to Use Internal Frames.
have look at JInternalFrames for MDI application
read Oracle tutorial, try code example

Facebook messenger application like docking

The Facebook messenger for windows 7 docks on the side of the screen and does not allow any other application to go on top of it.For example when i maximize another window , it does not cover the Facebook window.
How can i do this in java.
So far i can dock my window to the right, i set it undecorated and also always on top. But i want it to be like Facebook messenger so other windows can go maximize but only where it meets my docked window.
Here is a slimier question
http://www.dreamincode.net/forums/topic/278553-facebook-messenger-application-sidebar-like-docking-with-swing/

Swing components used for "splash" pages?

I see some Swing apps (like Eclipse) that load with a Welcome!/"splash" page. What kind of Swing component is this? Its sort of like a web page (like the old <imagemap>s!) embedded inside a Swing app and is very cool.
You could design the splash screen using an image editor, like Photoshop or GIMP. Save the image in a format that Java supports, like JPG, GIF, or PNG. Design the splash screen at a resolution that will work on low resolution devices like netbooks and projectors.
E.g. the Eclipse splash screen is ~450x300 pixels:
To display the image, you could use a JDialog whose border and close button have been hidden via setUndecorated(true). The JDialog could contain a single JLabel. Size both the JDialog and JLabel to be able to display the entire image. The JLabel's icon property should be set to the splash screen image.
You could display the splash screen for a fixed amount of time by employing Swing's Timer class. Consider allowing the user to optionally disable the splash screen so they don't always have to waste time watching it every time they start your program.
Or, rather than using a timer to display the splash screen for a fixed amount of time, you could consider hiding the splash screen as soon as the application has finished initializing. What "initializing the application" entails is specific to your application. This is the approach that Eclipse uses (its splash screen even has a progress bar).
Your question actually appears to be about the Eclipse "Welcome screen" (see screenshot below), not the Eclipse "splash screen". The Welcome Screen does include clickable areas. Java has some limited abilities to display HTML content. See http://docs.oracle.com/javase/tutorial/uiswing/components/html.html for some details. Java's built in support for HTML is pretty limited, and so it may not meet your needs. Here is a guide that talks about using a read-only JEditorPane to display HTML content, and capturing hyperlink click events to perform custom actions:
http://www.apl.jhu.edu/~hall/java/Swing-Tutorial/Swing-Tutorial-JEditorPane.html
Checkout this tutorial http://docs.oracle.com/javase/tutorial/uiswing/misc/splashscreen.html
Its really easy to do. Just create a splash screen entry in your manifest file that points to an image resource in your jar file.
e.g.
SplashScreen-Image: resources/splash.png
The image can even have transparency, so you can make it appear to be non-rectangular.

Categories