JAVA chapter17. javaFX. 17.10 JavaFX CSS 스타일(2)


17.10.3 border 속성




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?xml version="1.0" encoding="UTF-8"?>
 
<?import java.lang.*?>
<?import javafx.geometry.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.control.*?>
 
<HBox xmlns:fx="http://javafx.com/fxml" spacing="20">
   <padding>
      <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
   </padding>
   <children>
      <VBox id="vbox1" prefHeight="100" prefWidth="100"/>
      <VBox id="vbox2" prefHeight="100" prefWidth="100"/>
      <VBox id="vbox3" prefHeight="100" prefWidth="100"/>
      <VBox id="vbox4" prefHeight="100" prefWidth="100"/>
      <VBox id="vbox5" prefHeight="100" prefWidth="100"/>
   </children>
</HBox>
cs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#vbox1 {
    -fx-border-color: red;
    -fx-border-width: 1;
}
#vbox2 {
    -fx-border-color: red;
    -fx-border-width: 1;
    -fx-border-radius: 20;
}
#vbox3 {
    -fx-border-insets: 0, 10, 20;    
    -fx-border-color: red, green, blue;
    -fx-border-width: 1, 1, 1;
}
#vbox4 {
    -fx-border-insets: 0, 10, 20;    
    -fx-border-color: red, green white green white, blue;
    -fx-border-width: 1, 1, 1 3 3 1;
}
#vbox5 {
    -fx-border-color: red;
    -fx-border-width: 2;
    -fx-border-style: solid dotted dashed segments(3, 2, 8, 2);
}
cs


17.10.4 background 속성





1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#vbox1 {
    -fx-background-color: rgba(0001);
}
 
#vbox2 {
    -fx-background-color: linear-gradient(to right, #000000, #ffffff); 
}
 
#vbox3 {
    -fx-background-color: radial-gradient(center 5050%, radius 50%, #ffffff, #000000); 
}
 
#vbox4 {
    -fx-border-color: skyblue;
    -fx-background-image: url("images/icon.gif");
}
 
#vbox5 {
    -fx-border-color: skyblue;    
    -fx-background-image: url("images/icon.gif");
    -fx-background-repeat: no-repeat;
}
 
#vbox6 {
    -fx-border-color: skyblue;    
    -fx-background-image: url("images/icon.gif");
    -fx-background-repeat: no-repeat;
    -fx-background-position: center;
}
cs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?xml version="1.0" encoding="UTF-8"?>
 
<?import javafx.scene.layout.*?>
<?import javafx.geometry.*?>
 
<HBox xmlns:fx="http://javafx.com/fxml" spacing="10">
   <padding>
      <Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
   </padding>
   <children>
        <VBox id="vbox1" prefHeight="100" prefWidth="100" />
        <VBox id="vbox2" prefHeight="100" prefWidth="100" />    
        <VBox id="vbox3" prefHeight="100" prefWidth="100" />
        <VBox id="vbox4" prefHeight="100" prefWidth="100" />
        <VBox id="vbox5" prefHeight="100" prefWidth="100" />
        <VBox id="vbox6" prefHeight="100" prefWidth="100" />
   </children>
</HBox>
cs




Posted by 너래쟁이
: