Screen Docking in swing using JWindow - java

I am using JWindow to develop a bar which will appear on the top of the screen. The issue is that I want to dock it onto the screen and every other application should come under that. Currently the close and maximize buttons are going behind my application.
I have done some research, but I am unable to get it to work.
This question's answer gives me the idea but it doesn't really do what I want.

Related

NetBeans Change Scroll Bar Design

I have a question regarding JScrollPane.
I am making a java app in NetBeans with swing and I am using few Jlists. Two of them, have many items and a scrollbar appears to the right side.
When I edit the app the scrollbar looks the way I want, however when I run the app the design changes. The image in the link below shows what I mean.
How can I use the scrollbar design of netbeans look when I run the app?
scrollbar image
Thank you in advance!
You need to set a look and feel.
https://docs.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html

Swing -> JavaFX, how to create custom graphical applications using JavaFX

A while ago I wrote an application in Java using Swing for the GUI development. As I want to learn more about JavaFX I'm trying to convert it but I get stuck on one piece of my application I can't seem to find the right equivalent for in JavaFX. In Swing I was able to make a JPanel, create an image, and then rescale the image based on the size of the JPanel using the component events on the panel. Then I'd draw stuff on the image and draw that on the graphics of the JPanel. Also I'd use mouse events on the JPanel to implement zooming and panning on the underlying image.
I'm not sure whether this was good practise in the first place, but it enabled me to draw anything, from pixels to lines to circles to images, on the JPanel, essentially creating sort of a rendered viewport for my application.
What would be the best way to go about this in JavaFX? I've looked at tons of tutorials and youtube videos, but they all seem to focus just on normal GUI controls like buttons, and when I look at game dev for example they make a lot of use of standard JavaFX Nodes to quickly generate moving entities in their scene. I just need sort of a canvas to render stuff on as I please, but if I add something like a default Canvas or Region in the Scene Builder for my FXML file I don't know how to start drawing on that. I'm completely lost in the jungle of tutorials and documentation on the internet.
Does anyone know of any good resource for this kind of application cause I just don't know where to start.

javafx: disable or hide full screen button on mac os application title bar

I cannot figure this one out.
What I want to do is somehow disable the full-screen button on the right side of the title bar of the main application window, that seems to be a feature of Mountain Lion (10.8)+. It has two arrows pointing outwards diagonally.
There are related answers to this problem if the window is a dialog box, and an eclipse SWT-related solution here, but I need a solution to this problem if I have a single application primary-stage window, using javafx as the platform and netbeans 8 as the IDE.
I guess what I want is some way to access the cocoa API through javafx. Is this possible?
One way is to disable resizing completely:
stage.setResizable(false);

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.

Would it be appropriate to use JDesktopPane and JInternalFrame in this instance?

I'm writing a program that currently switches back and forth between different JPanels placed on a JFrame that also has a JMenuBar. (We're required to use Swing.)
I need to write a tutorial and right now I have it giving step-by-step instructions from a popup window. However, it doesn't seem to resonate well with test users and quite frankly it's annoying to switch back and forth between screens.
After checking out JDesktopPane and JInternalFrame it seems to make sense to place my entire program in a desktop pane and then create the tutorial using an internal frame. I'm worried that this will force me to place my different screens each in an internal frame which is NOT what I want to do. I just want the tutorial to be an internal popup(?) that can be minimized and moved around if necessary.
Am I going about this the correct way or is there a more efficient/practical way to implement the same tutorial popup feature?
I'm not 100% clear on your problem -- is it that your tutorial keeps popping up new windows for each step? I would assume that you wish both the main program and the tutorial to both be in view while the tutorial is running, and if this is so, perhaps the tutorial should reside in a non-modal JDialog, and then you swap tutorial screens via a CardLayout. ... unless I'm mis-reading your requirements and problem.

Categories