develope_kkyu

[JAVA fx] 야구 기록 관리 프로그램 만들기(실패) 본문

JAVA/Java SE

[JAVA fx] 야구 기록 관리 프로그램 만들기(실패)

developekkyu37 2022. 12. 22. 10:54
728x90

역량 부족으로 실패했습니다. 따라하지 않으시는 것을 추천드립니다.

 

AppMain.java

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class AppMain extends Application{
	
	@Override
	public void start(Stage primaryStage) throws Exception {
		FXMLLoader loader = new FXMLLoader(getClass().getResource("root.fxml"));
		Parent root = loader.load();
		RootController controller = loader.getController();
		controller.setPrimaryStage(primaryStage);
		
		Scene scene = new Scene(root);
		
		primaryStage.setTitle("야구 기록 관리 프로그램");
		primaryStage.setScene(scene);
		primaryStage.show();
	}
	
	public static void main(String[] args) {
		launch(args);
	}
}

PlayerController.java

import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.ResourceBundle;

import javafx.beans.property.StringProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.ComboBox;

public class PlayerController implements Initializable {
	
	 @FXML
	 private ComboBox<String> teamBox;
	 private static StringProperty teamName;
	 private List<String> teamList = new ArrayList<String>();
	
	 public PlayerController() {
	 }
	 
	 public PlayerController(StringProperty teamName) {
		 PlayerController.teamName = teamName;
	 }
	
	 @Override
		public void initialize(URL location, ResourceBundle resource) {
		 teamList.add(teamName.get());
		 for(int i=0; i<teamList.size(); i++) {
		 ObservableList fxComboNameList = FXCollections.observableArrayList(teamList.get(i));
		 teamBox.setItems(fxComboNameList);
		 }

	}
}

recordController.java

public class recordController {

}

RootController.java

import java.io.IOException;
import java.net.URL;
import java.util.ResourceBundle;

import javafx.application.Platform;
import javafx.event.ActionEvent;
import javafx.fxml.FXMLLoader;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class RootController implements Initializable {
	@Override
	public void initialize(URL location, ResourceBundle resources) {
	}
	
	private Stage primaryStage;	
	public void setPrimaryStage(Stage primaryStage) {
		this.primaryStage = primaryStage;
	}	
	
	public void handleTeamAction(ActionEvent e) throws Exception {
		try {
			FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("team.fxml"));
			Parent root = (Parent) fxmlLoader.load();
			Stage stage = new Stage();
			stage.setScene(new Scene(root));
			stage.setTitle("팀 등록");
			stage.show();
		}catch(IOException e1) {
			e1.printStackTrace();;
		}
	}
	public void handlePlayerAction(ActionEvent e) throws Exception {
		try {
			FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("player.fxml"));
			Parent root = (Parent) fxmlLoader.load();
			Stage stage = new Stage();
			stage.setScene(new Scene(root));
			stage.setTitle("선수 등록");
			stage.show();
		}catch(IOException e1) {
			e1.printStackTrace();;
		}
	}
	public void handleMatchAction(ActionEvent e) throws Exception {
		try {
			FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("match.fxml"));
			Parent root = (Parent) fxmlLoader.load();
			Stage stage = new Stage();
			stage.setScene(new Scene(root));
			stage.setTitle("경기 등록");
			stage.show();
		}catch(IOException e1) {
			e1.printStackTrace();;
		}
	}
	public void handleRecordsAction(ActionEvent e) throws Exception {
		try {
			FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("record.fxml"));
			Parent root = (Parent) fxmlLoader.load();
			Stage stage = new Stage();
			stage.setScene(new Scene(root));
			stage.setTitle("선수 기록");
			stage.show();
		}catch(IOException e1) {
			e1.printStackTrace();;
		}
	}
	public void handleExitAction(ActionEvent event) {
		Platform.exit();
	}
}

TeamController.java

import java.net.URL;
import java.util.ResourceBundle;

import javafx.beans.property.SimpleStringProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Button;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.TextField;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.input.MouseEvent;

public class TeamController implements Initializable  {
	  @FXML
	  private TableView<Team> myTableView;
	  @FXML
	  public TableColumn<Team, String> nameColumn;
	  @FXML
	  private TableColumn<Team, String> regionColumn;
	  @FXML
	  private TextField teamName;
	  @FXML
	  private TextField regionName;
	  @FXML
	  private Button teamAdd2;
	  
	  ObservableList<Team> teamList = FXCollections.observableArrayList(
			  );
	  
	  @Override
	  public void initialize(URL location, ResourceBundle resources) {
		  nameColumn.setCellValueFactory(cellData -> cellData.getValue().teamNameProperty());
		  regionColumn.setCellValueFactory(cellData -> cellData.getValue().regionNameProperty());
	      myTableView.setItems(teamList);
	 
	      teamAdd2.addEventHandler(MouseEvent.MOUSE_CLICKED, new EventHandler<MouseEvent>() {
	            @Override
	            public void handle(MouseEvent event) {
	                myTableView.getItems().add(new Team(new SimpleStringProperty(teamName.getText()), new SimpleStringProperty(regionName.getText())));
	            }
	        });
	  }
}

root.fxml

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

<?import javafx.scene.effect.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.input.*?>
<?import javafx.scene.image.*?>
<?import javafx.collections.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.Region?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.Border?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.image.ImageView?>
<?import javafx.scene.image.Image?>

<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="prjPr.RootController">
   <left>
      <VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0" spacing="100.0" BorderPane.alignment="CENTER">
         <children>
            <Button fx:id="team" mnemonicParsing="false" onAction="#handleTeamAction" text="팀 등록" />
            <Button fx:id="player" mnemonicParsing="false" onAction="#handlePlayerAction" text="선수 등록" />
         </children>
      </VBox>
   </left>
   <right>
      <VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0" spacing="100.0" BorderPane.alignment="CENTER">
         <children>
            <Button fx:id="match" mnemonicParsing="false" onAction="#handleMatchAction" text="경기 등록" />
            <Button fx:id="records" mnemonicParsing="false" onAction="#handleRecordsAction" text="선수 기록" />
         </children>
      </VBox>
   </right>
   <bottom>
      <HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0" BorderPane.alignment="CENTER">
         <children>
            <Button fx:id="exit" mnemonicParsing="false" onAction="#handleExitAction" text="나가기" />
         </children>
      </HBox>
   </bottom>
   <center>
      <VBox alignment="CENTER" prefHeight="245.0" prefWidth="295.0" BorderPane.alignment="CENTER">
         <children>
            <ImageView fitHeight="293.0" fitWidth="312.0" pickOnBounds="true" preserveRatio="true">
               <image>
                  <Image url="@images/5252663.png" />
               </image></ImageView>
         </children>
      </VBox>
   </center>
</BorderPane>

player.fxml

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

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

<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="625.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="prjPr.PlayerController">
   <left>
      <VBox alignment="CENTER" prefHeight="400.0" prefWidth="153.0" spacing="20.0" BorderPane.alignment="CENTER">
         <children>
            <Label text="팀 목록" />
            <ComboBox fx:id="teamBox" prefWidth="150.0" />
         </children>
      </VBox>
   </left>
   <center>
      <VBox alignment="CENTER" prefHeight="300.0" prefWidth="496.0" spacing="10.0" BorderPane.alignment="CENTER">
         <children>
            <Label text="선수 목록" />
            <TableView prefHeight="200.0" prefWidth="200.0">
              <columns>
                <TableColumn prefWidth="132.0" text="이름" />
                <TableColumn prefWidth="63.0" text="번호" />
                  <TableColumn prefWidth="110.0" text="나이" />
              </columns>
               <VBox.margin>
                  <Insets left="70.0" right="70.0" />
               </VBox.margin>
            </TableView>
         </children>
      </VBox>
   </center>
   <bottom>
      <HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0" spacing="10.0" BorderPane.alignment="CENTER">
         <children>
            <TextField prefHeight="23.0" prefWidth="115.0" promptText="이름" />
            <TextField prefHeight="23.0" prefWidth="67.0" promptText="번호" />
            <TextField prefHeight="23.0" prefWidth="63.0" promptText="나이" />
            <Button mnemonicParsing="false" text="추가" />
         </children>
      </HBox>
   </bottom>
</BorderPane>

match.fxml

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

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

<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="848.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
   <children>
      <VBox prefHeight="424.0" prefWidth="100.0">
         <children>
            <Label text="팀 선택">
               <VBox.margin>
                  <Insets left="20.0" top="10.0" />
               </VBox.margin>
            </Label>
            <ComboBox prefWidth="150.0">
               <VBox.margin>
                  <Insets left="20.0" top="10.0" />
               </VBox.margin>
            </ComboBox>
            <HBox alignment="CENTER_LEFT" prefHeight="30.0" prefWidth="600.0" spacing="15.0">
               <children>
                  <Label text="타순">
                     <HBox.margin>
                        <Insets />
                     </HBox.margin>
                  </Label>
                  <Label text="선수명">
                     <HBox.margin>
                        <Insets right="10.0" />
                     </HBox.margin>
                  </Label>
                  <Label text="타석">
                     <HBox.margin>
                        <Insets right="10.0" />
                     </HBox.margin>
                  </Label>
                  <Label text="타수">
                     <HBox.margin>
                        <Insets />
                     </HBox.margin>
                  </Label>
                  <Label text="1루타" />
                  <Label text="2루타" />
                  <Label text="3루타">
                     <HBox.margin>
                        <Insets right="3.0" />
                     </HBox.margin>
                  </Label>
                  <Label text="홈런">
                     <HBox.margin>
                        <Insets right="7.0" />
                     </HBox.margin>
                  </Label>
                  <Label text="타점">
                     <HBox.margin>
                        <Insets right="7.0" />
                     </HBox.margin>
                  </Label>
                  <Label text="득점">
                     <HBox.margin>
                        <Insets right="7.0" />
                     </HBox.margin>
                  </Label>
                  <Label text="볼넷">
                     <HBox.margin>
                        <Insets right="7.0" />
                     </HBox.margin>
                  </Label>
                  <Label text="사구">
                     <HBox.margin>
                        <Insets right="7.0" />
                     </HBox.margin>
                  </Label>
                  <Label text="도루" />
               </children>
            </HBox>
            <HBox alignment="CENTER" prefHeight="30.0" prefWidth="600.0" spacing="10.0">
               <children>
                  <Label text="1" />
                  <ComboBox prefHeight="23.0" prefWidth="59.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
               </children>
            </HBox>
            <HBox alignment="CENTER" prefHeight="30.0" prefWidth="600.0" spacing="10.0">
               <children>
                  <Label text="2" />
                  <ComboBox prefHeight="23.0" prefWidth="59.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
               </children>
            </HBox>
            <HBox alignment="CENTER" prefHeight="30.0" prefWidth="600.0" spacing="10.0">
               <children>
                  <Label text="3" />
                  <ComboBox prefHeight="23.0" prefWidth="59.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
               </children>
            </HBox>
            <HBox alignment="CENTER" prefHeight="30.0" prefWidth="600.0" spacing="10.0">
               <children>
                  <Label text="4" />
                  <ComboBox prefHeight="23.0" prefWidth="59.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
               </children>
            </HBox>
            <HBox alignment="CENTER" prefHeight="30.0" prefWidth="600.0" spacing="10.0">
               <children>
                  <Label text="5" />
                  <ComboBox prefHeight="23.0" prefWidth="59.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
               </children>
            </HBox>
            <HBox alignment="CENTER" prefHeight="30.0" prefWidth="600.0" spacing="10.0">
               <children>
                  <Label text="6" />
                  <ComboBox prefHeight="23.0" prefWidth="59.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
               </children>
            </HBox>
            <HBox alignment="CENTER" prefHeight="30.0" prefWidth="600.0" spacing="10.0">
               <children>
                  <Label text="7" />
                  <ComboBox prefHeight="23.0" prefWidth="59.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
               </children>
            </HBox>
            <HBox alignment="CENTER" prefHeight="30.0" prefWidth="600.0" spacing="10.0">
               <children>
                  <Label text="8" />
                  <ComboBox prefHeight="23.0" prefWidth="59.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
               </children>
            </HBox>
            <HBox alignment="CENTER" prefHeight="30.0" prefWidth="600.0" spacing="10.0">
               <children>
                  <Label text="9" />
                  <ComboBox prefHeight="23.0" prefWidth="59.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
               </children>
            </HBox>
         </children>
      </VBox>
      <VBox prefHeight="424.0" prefWidth="100.0">
         <children>
            <Label text="팀 선택">
               <VBox.margin>
                  <Insets left="20.0" top="10.0" />
               </VBox.margin>
            </Label>
            <ComboBox prefWidth="150.0">
               <VBox.margin>
                  <Insets left="20.0" top="10.0" />
               </VBox.margin>
            </ComboBox>
            <HBox alignment="CENTER_LEFT" prefHeight="30.0" prefWidth="600.0" spacing="15.0">
               <children>
                  <Label text="타순">
                     <HBox.margin>
                        <Insets />
                     </HBox.margin>
                  </Label>
                  <Label text="선수명">
                     <HBox.margin>
                        <Insets right="10.0" />
                     </HBox.margin>
                  </Label>
                  <Label text="타석">
                     <HBox.margin>
                        <Insets right="10.0" />
                     </HBox.margin>
                  </Label>
                  <Label text="타수">
                     <HBox.margin>
                        <Insets />
                     </HBox.margin>
                  </Label>
                  <Label text="1루타" />
                  <Label text="2루타" />
                  <Label text="3루타">
                     <HBox.margin>
                        <Insets right="3.0" />
                     </HBox.margin>
                  </Label>
                  <Label text="홈런">
                     <HBox.margin>
                        <Insets right="7.0" />
                     </HBox.margin>
                  </Label>
                  <Label text="타점">
                     <HBox.margin>
                        <Insets right="7.0" />
                     </HBox.margin>
                  </Label>
                  <Label text="득점">
                     <HBox.margin>
                        <Insets right="7.0" />
                     </HBox.margin>
                  </Label>
                  <Label text="볼넷">
                     <HBox.margin>
                        <Insets right="7.0" />
                     </HBox.margin>
                  </Label>
                  <Label text="사구">
                     <HBox.margin>
                        <Insets right="7.0" />
                     </HBox.margin>
                  </Label>
                  <Label text="도루" />
               </children>
            </HBox>
            <HBox alignment="CENTER" prefHeight="30.0" prefWidth="600.0" spacing="10.0">
               <children>
                  <Label text="1" />
                  <ComboBox prefHeight="23.0" prefWidth="59.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
               </children>
            </HBox>
            <HBox alignment="CENTER" prefHeight="30.0" prefWidth="600.0" spacing="10.0">
               <children>
                  <Label text="2" />
                  <ComboBox prefHeight="23.0" prefWidth="59.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
               </children>
            </HBox>
            <HBox alignment="CENTER" prefHeight="30.0" prefWidth="600.0" spacing="10.0">
               <children>
                  <Label text="3" />
                  <ComboBox prefHeight="23.0" prefWidth="59.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
               </children>
            </HBox>
            <HBox alignment="CENTER" prefHeight="30.0" prefWidth="600.0" spacing="10.0">
               <children>
                  <Label text="4" />
                  <ComboBox prefHeight="23.0" prefWidth="59.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
               </children>
            </HBox>
            <HBox alignment="CENTER" prefHeight="30.0" prefWidth="600.0" spacing="10.0">
               <children>
                  <Label text="5" />
                  <ComboBox prefHeight="23.0" prefWidth="59.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
               </children>
            </HBox>
            <HBox alignment="CENTER" prefHeight="30.0" prefWidth="600.0" spacing="10.0">
               <children>
                  <Label text="6" />
                  <ComboBox prefHeight="23.0" prefWidth="59.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
               </children>
            </HBox>
            <HBox alignment="CENTER" prefHeight="30.0" prefWidth="600.0" spacing="10.0">
               <children>
                  <Label text="7" />
                  <ComboBox prefHeight="23.0" prefWidth="59.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
               </children>
            </HBox>
            <HBox alignment="CENTER" prefHeight="30.0" prefWidth="600.0" spacing="10.0">
               <children>
                  <Label text="8" />
                  <ComboBox prefHeight="23.0" prefWidth="59.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
               </children>
            </HBox>
            <HBox alignment="CENTER" prefHeight="30.0" prefWidth="600.0" spacing="10.0">
               <children>
                  <Label text="9" />
                  <ComboBox prefHeight="23.0" prefWidth="59.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
                  <TextField prefHeight="23.0" prefWidth="36.0" />
               </children>
            </HBox>
            <HBox alignment="CENTER" prefHeight="31.0" prefWidth="600.0" spacing="50.0">
               <VBox.margin>
                  <Insets top="15.0" />
               </VBox.margin>
               <children>
                  <Button mnemonicParsing="false" text="등록" />
               </children>
            </HBox>
         </children>
      </VBox>
   </children>
</VBox>

team.fxml

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

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

<VBox alignment="CENTER" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" spacing="50.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="prjPr.TeamController">
   <children>
      <TableView fx:id="myTableView" prefHeight="287.0" prefWidth="600.0">
        <columns>
          <TableColumn fx:id="nameColumn" prefWidth="300.0" text="팀 이름" />
          <TableColumn fx:id="regionColumn" minWidth="0.0" prefWidth="300.0" text="지역" />
        </columns>
      </TableView>
      <HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0" spacing="20.0">
         <children>
            <TextField fx:id="teamName" promptText="팀 이름" />
            <TextField fx:id="regionName" promptText="지역" />
            <Button fx:id="teamAdd2" mnemonicParsing="false" text="추가" />
         </children>
      </HBox>
      <Pane prefHeight="45.0" prefWidth="600.0" />
   </children>
</VBox>

record.fxml

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

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

<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="531.0" prefWidth="1271.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
   <top>
      <VBox prefHeight="70.0" prefWidth="620.0" BorderPane.alignment="CENTER">
         <children>
            <Label text="팀 선택">
               <VBox.margin>
                  <Insets left="10.0" top="10.0" />
               </VBox.margin>
            </Label>
            <ComboBox prefWidth="150.0">
               <VBox.margin>
                  <Insets left="10.0" top="10.0" />
               </VBox.margin>
            </ComboBox>
         </children>
      </VBox>
   </top>
   <left>
      <VBox prefHeight="461.0" prefWidth="128.0" BorderPane.alignment="CENTER">
         <children>
            <Label text="선수 목록">
               <VBox.margin>
                  <Insets left="10.0" top="20.0" />
               </VBox.margin>
            </Label>
            <ListView prefHeight="200.0" prefWidth="139.0">
               <VBox.margin>
                  <Insets top="10.0" />
               </VBox.margin>
            </ListView>
         </children>
         <padding>
            <Insets left="10.0" right="10.0" />
         </padding>
      </VBox>
   </left>
   <center>
      <VBox prefHeight="200.0" prefWidth="100.0" BorderPane.alignment="CENTER">
         <children>
            <Label text="기록">
               <VBox.margin>
                  <Insets left="10.0" top="20.0" />
               </VBox.margin>
            </Label>
            <TableView prefHeight="200.0" prefWidth="200.0">
              <columns>
                <TableColumn prefWidth="60.0" text="타율" />
                <TableColumn prefWidth="60.0" text="게임수" />
                  <TableColumn prefWidth="60.0" text="타석" />
                  <TableColumn prefWidth="60.0" text="타수" />
                  <TableColumn prefWidth="60.0" text="득점" />
                  <TableColumn prefWidth="60.0" text="총안타" />
                  <TableColumn prefWidth="60.0" text="1루타" />
                  <TableColumn prefWidth="60.0" text="2루타" />
                  <TableColumn prefWidth="60.0" text="3루타" />
                  <TableColumn prefWidth="60.0" text="홈런" />
                  <TableColumn prefWidth="60.0" text="타점" />
                  <TableColumn prefWidth="60.0" text="득점" />
                  <TableColumn prefWidth="60.0" text="도루" />
                  <TableColumn prefWidth="60.0" text="볼넷" />
                  <TableColumn prefWidth="60.0" text="사구" />
                  <TableColumn prefWidth="60.0" text="삼진" />
                  <TableColumn prefWidth="60.0" text="장타율" />
                  <TableColumn prefWidth="60.0" text="출루율" />
                  <TableColumn prefWidth="60.0" text="ops" />
              </columns>
               <VBox.margin>
                  <Insets top="10.0" />
               </VBox.margin>
            </TableView>
         </children>
      </VBox>
   </center>
</BorderPane>

root

match

player

record

728x90