MainView.fxml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <?import java.lang.*?>
  3. <?import javafx.geometry.*?>
  4. <?import javafx.scene.control.*?>
  5. <?import javafx.scene.image.*?>
  6. <?import javafx.scene.layout.*?>
  7. <?import javafx.scene.text.*?>
  8. <?import javafx.geometry.Insets?>
  9. <?import javafx.scene.control.Button?>
  10. <?import javafx.scene.control.Label?>
  11. <?import javafx.scene.control.ListView?>
  12. <?import javafx.scene.control.TextArea?>
  13. <?import javafx.scene.image.Image?>
  14. <?import javafx.scene.image.ImageView?>
  15. <?import javafx.scene.layout.BorderPane?>
  16. <?import javafx.scene.layout.HBox?>
  17. <?import javafx.scene.layout.VBox?>
  18. <?import javafx.scene.text.Font?>
  19. <BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="399.0"
  20. prefWidth="600.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1"
  21. fx:controller="com.chat.Controller.MainController">
  22. <left>
  23. <!--左侧区域-->
  24. <VBox prefHeight="351.0" prefWidth="200.0" BorderPane.alignment="CENTER">
  25. <children>
  26. <HBox prefHeight="6.0" prefWidth="200.0" style="-fx-background-color: #d6d2d2;">
  27. <children>
  28. <!--服务器在线人数-->
  29. <Label fx:id="labUserCounter" textAlignment="CENTER">
  30. <font>
  31. <Font name="Britannic Bold" size="13.0"/>
  32. </font>
  33. <HBox.margin>
  34. <Insets left="7.0" top="7.0"/>
  35. </HBox.margin>
  36. </Label>
  37. </children>
  38. </HBox>
  39. <!--用户列表-->
  40. <ListView fx:id="userGroup" prefHeight="290.0" prefWidth="200.0"/>
  41. </children>
  42. <BorderPane.margin>
  43. <Insets right="5.0"/>
  44. </BorderPane.margin>
  45. </VBox>
  46. </left>
  47. <top>
  48. <!--头框-->
  49. <HBox prefHeight="50.0" prefWidth="200.0" spacing="4.0" style="-fx-background-color: black;"
  50. BorderPane.alignment="CENTER">
  51. <children>
  52. <!--头像-->
  53. <ImageView fitHeight="40.0" fitWidth="40.0" pickOnBounds="true" preserveRatio="true">
  54. <image>
  55. <Image url="/image/head.png"/>
  56. </image>
  57. <HBox.margin>
  58. <Insets left="10.0" top="5.0"/>
  59. </HBox.margin>
  60. </ImageView>
  61. <Label fx:id="labUserName" contentDisplay="CENTER" graphicTextGap="0.0" rotate="-2.0" text="Label"
  62. textFill="WHITE" textOverrun="WORD_ELLIPSIS">
  63. <padding>
  64. <Insets left="30.0"/>
  65. </padding>
  66. <opaqueInsets>
  67. <Insets/>
  68. </opaqueInsets>
  69. <font>
  70. <Font name="Segoe UI Semibold Italic" size="20.0"/>
  71. </font>
  72. <HBox.margin>
  73. <Insets top="10.0"/>
  74. </HBox.margin>
  75. </Label>
  76. <Label fx:id="labChatTip" text="Group Chat" textFill="WHITE">
  77. <padding>
  78. <Insets left="150.0" top="10.0"/>
  79. </padding>
  80. <font>
  81. <Font name="Georgia Bold" size="18.0"/>
  82. </font>
  83. </Label>
  84. </children>
  85. </HBox>
  86. </top>
  87. <center>
  88. <BorderPane prefHeight="300.0" prefWidth="200.0" BorderPane.alignment="CENTER">
  89. <center>
  90. <!--聊天框-->
  91. <ListView fx:id="chatWindow" prefHeight="300.0" prefWidth="200.0" BorderPane.alignment="CENTER" >
  92. <BorderPane.margin>
  93. <Insets bottom="5.0" right="2.0"/>
  94. </BorderPane.margin>
  95. </ListView>
  96. </center>
  97. <bottom>
  98. <VBox prefHeight="100.0" prefWidth="200.0" BorderPane.alignment="CENTER">
  99. <children>
  100. <!--发送框-->
  101. <TextArea fx:id="textSend" prefHeight="82.0" prefWidth="393.0"/>
  102. <HBox prefHeight="50.0" prefWidth="200.0" spacing="20.0">
  103. <children>
  104. <!--表情包emoji的按钮-->
  105. <Button fx:id="btnEmoji" mnemonicParsing="false" onAction="#onEmojiBtnClcked"
  106. style="-fx-background-color: orange;" text="emoji">
  107. <HBox.margin>
  108. <Insets left="250.0"/>
  109. </HBox.margin>
  110. </Button>
  111. <!--发送按钮-->
  112. <Button fx:id="btnSend" mnemonicParsing="false" style="-fx-background-color: orange;"
  113. text="send"/>
  114. </children>
  115. </HBox>
  116. </children>
  117. <opaqueInsets>
  118. <Insets right="2.0"/>
  119. </opaqueInsets>
  120. <BorderPane.margin>
  121. <Insets right="2.0"/>
  122. </BorderPane.margin>
  123. </VBox>
  124. </bottom>
  125. </BorderPane>
  126. </center>
  127. </BorderPane>