How to create a window with its own window border other than the local system window border?

How to create a window with its own window border other than the local system window border?

For example, a border: a black line with a width of 1, then a transparent line with a width of 5. Inside, it's the content pane.

In JavaSE, there seems to be for the JFrame paintComponent() method to realize the effect.

I can't see what you're trying to do now: it's a little trickier. You need stage.initStyle (StageStyle.TRANSPARENT), and I think you have to imitate the transparent part of the border by the presence of a second vessel inside the root container, properly positioned.

Something like:

import javafx.application.Application;
import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
import javafx.stage.StageStyle;

public class CustomBorderExample extends Application {

  @Override
  public void start(Stage primaryStage) {
  AnchorPane root = new AnchorPane();
  root.setStyle("-fx-border-color: black; -fx-border-width: 1px; ");

  StackPane mainContainer = new StackPane();
    AnchorPane.setTopAnchor(mainContainer, 5.0);
    AnchorPane.setLeftAnchor(mainContainer, 5.0);
    AnchorPane.setRightAnchor(mainContainer, 5.0);
    AnchorPane.setBottomAnchor(mainContainer, 5.0);
  mainContainer.setStyle("-fx-background-color: aliceblue;");
  root.getChildren().add(mainContainer);

  primaryStage.initStyle(StageStyle.TRANSPARENT);
  final Button closeButton = new Button("Close");
    mainContainer.getChildren().add(closeButton);
    closeButton.setOnAction(new EventHandler() {
      @Override
      public void handle(ActionEvent event) {
        Platform.exit();
      }
    });
  primaryStage.setScene(new Scene(root,  300, 200, Color.TRANSPARENT));
  primaryStage.show();
  }

  public static void main(String[] args) {
  launch(args);
  }
}

Tags: Java

Similar Questions

  • How to better convert 01:56 and not lose quality other than the 4 K to 2 k

    If I take a 4 K produce and convert/low res to 2 k by 2 k, importing in a time line am I lose quality other than the 2 k low res? Is it bad for the film? Does make a difference if the position would give me a 2 k vs file to me? It's a feature and I need lower res that it creates a DCP. so I'm concerned about quality. And is it all still do not lose quality on import and export. It seems that I lose 15GB.

    YYou are reducing the resolution, but you're not really lower the quality. There should be no difference between you do it or someone else do it. The file will be much lower in 2K 4 K. It is to be expected.

  • How Win764() will not work if I install programs elsewhere other than the default Program Files folders?

    The reason for this question is that I want both 1.) Learn more about Win7 64 bit works, as well as 2.) understand the scope of customization possible.

    In any case, first of all, what this scenario: what happens if I create a subfolder in each of the two Program Files folders? Say, in the (x 86) program, I create a subfolder called Programs (x 86). Or another name, whatever and say that I do the same thing for the Program Files folder. So, what happens if instead of installing all my software back into the default directory Program Files or program (x 86), what happens if I start to install in these subdirectories to the place?

    Everything works fine? I heard that these two Program Files folders have assignments to special access for security reasons. As I start working on these issues, the same security structure would be preserved, correct? Second, everything will work correctly not only wise, but in terms of features? I know that each of the Program Files folders also has its own common files folder. If I make my method, installed programs to put their files in the Common Files folder correctly, and then get back them properly when necessary?

    Finally, I would also like to know out of curiosity, what would happen if I don't use the program files directories at all and instead started to install things in a completely different directory. But that is less an issue for me at the moment. I just want to know if what I have set out above would be good or not.

    Thank you!

    Hi StormRyder

    This issue is beyond the scope of these level consumer forums.

    I would recommend that you post on the Technet ITPro Windows 7 forumsfollow-up questions. Advanced on these forums users are more familiar with these types of settings, and may explain some of the common pitfalls you may encounter, as well as how to be ready in case something goes wrong.

    I hope this helps.

    Thank you for using Windows 7

    Ronnie Vernon MVP
  • How to create a text with text partly hidden behind objects in the picture? [was: Photoshop]

    I'm putting a text with the text with some letters missing completely behind the objects in the image, while the letters to open a space of course not be affected. Those behind the objects. If anyone knows how to do this, it would be great.

    Add your text to create a dynamic object, add the layer shows all go to blending options and add a gradient to your text overlay.

  • How to create a table with two unique columns

    How to create a table with two unique columns. I use the following syntax below and I get the error message such unique or primary key already exists.

    create the table COPQ_WORKCELL_GOAL
    (
    Type_id varchar2 (4) NOT NULL UNIQUE,
    Tyle_Location varchar2 (30) NOT NULL UNIQUE,
    Type_Description varchar2 (20).
    KEY elementary SCHOOL (Type_id)
    );

    Use 1 or the other column type_id;

    create table COPQ_WORKCELL_GOAL
    (
      Type_id varchar2(4),
      Tyle_Location varchar2(30) NOT NULL UNIQUE,
      Type_Description varchar2(20),
      PRIMARY KEY (Type_id)
    );
    
    Table created
    drop table COPQ_WORKCELL_GOAL;
    
    Table dropped
    create table COPQ_WORKCELL_GOAL
    (
      Type_id varchar2(4) primary key,
      Tyle_Location varchar2(30) NOT NULL UNIQUE,
      Type_Description varchar2(20)
    );
    
    Table created
    
  • In the Photos of El Capitan how to record a double published in a separate with its own name and the ID file file?

    In the Photos of El Capitan how to record a double published in a separate with its own name and the ID file file?

    Only by exporting - with Photos (and iPhoto and Aperture) - you can have several versions of an image by duplicating the image (control - D), but this does not create an image file separated until you export - it creates a separate edit list in the database that applies to the original when you watch or export the photos

    Photos as it were its predecessors is a non-destructive control Digital Asset Manager (DAM) which does not any changes to files in the database but built a list of validation

    LN

  • How to create Hlp files with labwindows 9.0

    Hello

    I used to create the dll with Labwindows 8.5 and use them with TestStand... The advantage is that with the help file, I can add information to the Fp file and loading the DLL with TestStand, the "?" button to open the help file...

    But the problem is that I can't find help with Labwindows 9.0 generation...

    Does anyone know how to create file hlp with Labwindows 9.0?

    The procedure with Labwindows 8.5 has been:

    Modification of the PS file, then generate the Option-> windows help

    Thank you very much

    Ronan

  • the upgrade of my hard drive on an hp laptop. How to create a windows cd? KeyCode on laptop wallpaper

    the upgrade of my hard drive on an hp laptop.  How to create a windows cd?  KeyCode on laptop wallpaper

    You n "t do it this way.

    You use cloning software to clone your existing to the new disk drive.  For portable computers, you will need to purchase an external hard drive enclosure which is (a) compatible with your drive (SATA or PATA) interface and (b) compatible with external connections on your laptop (for example, USB, FireWire, eSata).  Do not spend a lot of money for this speaker ($ 10-$ 20).

    If your new hard drive Western Digital, you can get the free cloning (a 'special' version of Acronis True Image) of WD software (http://support.wdc.com/product/downloaddetail.asp?swid=119) or you can get it separately (this is not an exhaustive list and is in no particular order):

    Acronis True Image Home 11
    EASEUS ToDo Backup
    Paragon Drive Copy or Partition Manager Personal
    Casper
    Norton Ghost

    The process is simple:

    1. Install the software on your laptop for cloning
    2. RTFM (do not skip this step)
    3. Install the new drive in the external case
    4. Connect new player to the computer
    5. Clone original disc on new drive
    6. Stop
    7. Unplug the external computer case
    8. Exchange records (original for external disk) and the new laptop drive
    9. Reboot and enjoy your new drive.

    When you know that the cloning operation was successful, format the old drive, which is now in the external case and use it for backup of data.

  • How to bridge two computers with their own operating system, Server1 to Server2 in the same room.

    Original title: bridge two segents HOW?

    Seem like MS does not explain how to fill two computers with their own operating system-> beautiful graphics and he said it's possible-> we know how to add segments to the bridge after its creation?  Server1 to Server2 in the same room.

    This issue is beyond the scope of this site and must be placed on Technet or MSDN

    http://social.msdn.Microsoft.com/forums/en-us/home

  • Create a gradient with my own

    This may seem like a really stupid question, but how to create a gradient using my own colors? I've recently updated CS3 form where I could just drag a shade of color on the slider to set the color of gradient. Now I can not do. If I try with one of the default colors it works without problem, but if I create my own swatch and then I get a circle with a line through it, saying: I can't do it.

    I'm probably wrong but I can not work what and you'd be grateful for any help.

    Thank you

    Lucy,

    There may be something wrong with the prferences. Try the following (you may have tried / some of them already) and see if that helps you (the following is a general list of things, try when he's not in a file specific; 3) and 4) specifically may be corrupted preferences):

    (1) close Illy and open again.

    (2) restart the computer (maybe three times);

    (3) close Illy and press Ctrl + Alt + Shift / Cmd + Option + shift during startup (easy, but irreversible);

    4) to move the folder with closed Illy (more tedious but also more thorough and reversible);

    ((5) browse and try the relevant among the other options (point 7) is a list of the usual suspects among other applications which can disturb and confuse Illy);

    Even worse, if no other solution appears, you can:

    (6) uninstall, run the cleanup tool and reinstall.

    http://www.Adobe.com/support/contact/cscleanertool.html

  • 5.6.1 pages: How to create a table with more than 999 lines?

    5.6.1 pages: How to create a table with more than 999 lines?

    The table on Pages v5.6.1 line selector is limited 3-digit, as it is in Pages ' 09 v4.3. Either use LibreOffice Writer, who does not have any constraint line on processing tables 3-digit, or any application spreadsheet for top 3-digit row needs.

  • How to restore a flashdrive with its original files that have been replaced or removed?

    Original title: how to restore a flashdrive with its original files?  I accidentally replaced a file with an earlier version of this file.

    Missing file

    Hi, David B.Erkens,.
     

    Unfortunately, you can not recover the file from the flash drive. You may need to use some third party recovery software to get the file.

    Please use your favorite search engine and browse for such a program that is used to.

    Note: This response contains a reference to third party World Wide Web site. Microsoft provides this information as a convenience to you. Microsoft does not control these sites and no has not tested any software or information found on these sites; Therefore, Microsoft cannot make any approach to quality, security or the ability of a software or information that are there. There are the dangers inherent in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

  • How to create an app with space name?

    Hi all

    How to create an application with the space, for example "Hello Word" name When I run my Simulator, I got ' Hello$ 20World "instead. I use the plugin for eclipse for development. I can see the Application descriptor for my application, and it shows the thin space. I tried to change the Blackberry project properties tab generate file output name, but it doesn't help in any way. Please advise...

    Goto Blackberry project properties

    Click the general tab

    Write in title = "Hello World".

    and you can see your title of the modified project

    I hope that you ask for it only!

  • How to create an entity with more than one primary key.

    Hello

    JDeveloper Version 11.1.2.4.0

    I am trying to create an entity object based on a table with 5 columns. The combination of them is unique.

    I do the five columns of primary keys, but when I delete a line I: RowAlreadyDeletedException, although always the line exists in the database.

    Also displaying the view sometimes I get Houston-25019: line entity oracle.jbo.Key [1 key 2 null null NULL].



    How to create an entity based on one object several columns in the primary key?

    I don't want to add an additional column to a primary key, because this table is used in many PL/SQL procedures, and I'm not sure that this will not affect the.

    Also using Rowid as a primary key should be avoided.

    Kind regards

    Pamela.

    As I said, the framework is not like that

    Check this old (but still relevant) blog of Sung Im on Table Whose Primary Key entity object can be NULL

    describing the reason behind the behavior you're seeing and the way around.

    Or you use the secondary key rather as described here Wael Abdeen Blog, how to look at the views - part 2 | Oracle ADF as a secondary key composed of more then one column can have null values.

    Timo

  • How to create a form with a submit in CC button animate using Actionscript 3

    How to create a form with a submit in CC button animate using Actionscript 3. The file will first be a SWF but will also have the flexibility to export as HTML5

    I've searched high and low for an example of code for this entry.

    Can someone help me please?

    Thank you

    You can use the same graphic assets of basis for two projects, but the coding will be different for everyone.  You must work on the project of a code at a time.

Maybe you are looking for

  • Display number and the name of the caller

    Greetings, I have an Iphone 6 IOS 9.3.3 when I get a call, is only to show the name of the appellant, I want to view calling name and number. I tried so hard, but I have found no Solution.

  • How can I change my primary email address?

    I have 2 gmail accounts. I want to change my current main account and the other gmail account my primary. I can't find anywhere in my account settings to do this. I have a MAC with OS Lion. Everything is updated.

  • * downgrade interface *.

    Hello I am a user of windows 7 and never had feelings for the style "metro of windows 8. Now, I had to update my Skype and it became this 'horrible, we give you toucherino"Skype... Can I downgrade it? / keep the old version for windows 7? Thanks in a

  • HDMI port stopped working on Satellite L655

    Hi all I've always been able to connect my laptop to the TV via an HDMI cable, but it has stopped working. Any body had the same problem or knows how to solve? Its model L655. Thank you

  • laptop will not power

    I recently bought a HP compaq presario notebook cq60 product #wa588ua #abamodel #cq60-615dx with Windos 7 home 64 bit version. I have not had any problems with him lately, I recently bought a battery 12 cells for him and came through the process of t