JavaFX Use Faq__java

Source: Internet
Author: User

1:q: In Hbox, how to make a part of a control to the left, part of the control to the right, and regardless of how the window size remains relative to the same position, the layout is as follows:

[Left Control] [Controls that are automatically scaled in the middle] [Right Control]

A: The middle will be scalable control using region, and set its hgrow for always, reference Fxml source code is as follows:

<region prefheight= "34.0" prefwidth= "102.0" hbox.hgrow= "ALWAYS"/>

The data in the 2:q:tableview cannot be displayed, and the system does not prompt for error messages.

A: There is a possibility that the corresponding data model class has no Get/set method. Note, however, that there may be other possibilities, such as a corresponding property name error.

3: How to perform the code operation interface after initializing the interface. Method 1: Make the controller implements initializable interface, processing in the Initialize Method 2: After you show the interface in Applicaiton, call the method in controller:

Fxmlloader Fxmlloader = new Fxmlloader (GetClass (). GetResource ("Manager.fxml"));
   Parent root = (parent) fxmlloader.load ();
   Managercontroller controller = (Managercontroller) fxmlloader.getcontroller ();	 Parent root = Fxmlloader.load (GetClass (). GetResource ("Manager.fxml"));
  Scene Scene = new Scene (root);
  Primarystage.setscene (scene);
  Primarystage.setmaximized (true);
  Primarystage.show ();
  Controller.showinfo ("Interface Initialization complete");


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.