Javafx 2.0 Summary

Source: Internet
Author: User

1. For the onaction event of the button, define the method in the fxml file: onaction = "# processlogin"

In its corresponding controller, the signature of the method is: @ fxml protected void processlogin (actionevent event) [or private]

However, if it is another event type, the general format is: Define the method in the fxml file: onmouseclicked = "# handlewinclose"

The corresponding method signature is: @ fxml private void handlewinclose (mouseevent event) [or protected]

 

2. The public void initialize (URL location, resourcebundle resources) method of the controller class is called after the fxml file is loaded, so you can give some components in the interface here.

Add event listening or initialize the values of some components on the Interface

 

3. tiigane: When tiigane is used in javafx scene builder, two alignment items are displayed on the attribute panel on the right! One is alignment and the other is tile alignment. Pay attention to the difference!

First of all, the word tile is the meaning of the tile. Think about it. The tiles are arranged side by side in a row, and all of them are of the same size. This is the tile layout, tistmane!

Alignment: Set tiles alignment in tistmane. This is similar to setting the text alignment in Word. Generally, it is set to top_left, indicating that the component (tile) is placed from the upper left corner );

Tilealignment: sets the layout mode inside each tile (tile). I like to align and set it to center.

4. scrollpane: It can display the pane of the scroll bar, but you can set the barpolicy to set the bar display mode: Never? Always? Needed? Generally, it uses needed!

Another attribute is pannable. If it is set to true, you can move scroll pane content to view the content. The scroll bar will automatically move to the corresponding position!

 

5. blendmode: Blend means superposition. blendmode means superposition. There are many common add, mutiply, blue, green, and red methods... This is useful!

Generally, pane has its own background color by default, but sometimes we want pane to use the original background color instead of its default background color, as shown in the right figure below, set it to mutiply,

You can also choose the most suitable mode based on the situation, because some modes will make the content displayed on pane different, because it is superimposed!

 

6.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.