2013-02-28 9 views
1

내가 자바 FX와 샘플 CRUD 응용 프로그램을 짓고 있어요 축소 할 때 버튼이 중 VBOX 레이아웃의 외출이 내 FXML 파일입니다자바 FX 2.2 : 무대

<?xml version="1.0" encoding="UTF-8"?> 

<?import java.lang.*?> 
<?import java.util.*?> 
<?import javafx.geometry.*?> 
<?import javafx.scene.control.*?> 
<?import javafx.scene.layout.*?> 
<?import javafx.scene.paint.*?> 

<BorderPane fx:id="root" depthTest="ENABLE" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" 
         xmlns:fx="http://javafx.com/fxml" fx:controller="org.tarrsalah.persona.gui.MainViewPresenter"> 

    <center> 
     <TableView fx:id="table" minHeight="500.0" minWidth="600.0" prefHeight="-1.0" prefWidth="-1.0"> 
      <columns> 
       <TableColumn prefWidth="75.0" text="name" fx:id="name" /> 
       <TableColumn prefWidth="75.0" text="last name" fx:id="lastname" /> 
      </columns> 
      <BorderPane.margin> 
       <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" /> 
      </BorderPane.margin> 
     </TableView> 
    </center> 

    <right> 
     <VBox VBox.vgrow="ALWAYS" fillWidth="true" spacing="10.0" BorderPane.alignment="TOP_LEFT" minWidth="200" > 
      <children > 
       <Button fx:id="newP" prefWidth="100.0" minWidth="80" text="New" VBox.vgrow="NEVER" /> 
       <Button fx:id="alter" prefWidth="100.0" minWidth="80" text="Alter" VBox.vgrow="NEVER" /> 
       <Button fx:id="remove" prefWidth="100.0" minWidth="80" text="remove" VBox.vgrow="NEVER" /> 
      </children> 
      <padding> 
       <Insets left="20.0" right="20.0" top="10.0" /> 
      </padding>  
     </VBox> 
    </right> 
</BorderPane> 

무대에게 모든 버튼의 크기를 조정하려고 당신이

before shrinkin after shrinking

가 어떻게 축소에서 중 VBOX 창을 보존 할 수 있습니다 볼 수 중 VBOX 레이아웃의 외출?

+1

TableView에서 minWidth = "600.0"을 제거하려고 했습니까? – gontard

+0

아니, 고마워요 @ gontard – tarrsalah

+0

minWith를 제거하면 문제가 해결 되었습니까? – gontard

답변

0

이 동작은 TableView의 최소 너비 제한으로 인해 발생합니다.

<TableView fx:id="table" minHeight="500.0" minWidth="600.0" prefHeight="-1.0" prefWidth="-1.0"> 

당신은 속성 minWidth="600.0"를 제거해야하는 TableView은 600PX 이하의 폭을 줄일 수 있습니다.