Created
June 25, 2014 21:11
-
-
Save anonymous/be60bb89181376ff12aa to your computer and use it in GitHub Desktop.
Jira RT37705
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package jira37705; | |
import javafx.application.Application; | |
import javafx.geometry.Orientation; | |
import javafx.geometry.Pos; | |
import javafx.scene.Scene; | |
import javafx.scene.control.Label; | |
import javafx.scene.layout.FlowPane; | |
import javafx.stage.Stage; | |
public class MainJavaFx extends Application { | |
public static void main(String[] args) { | |
launch(args); | |
} | |
@Override | |
public void start(Stage stage) { | |
Label label80 = new Label("Font size: 80px"); | |
label80.setStyle("-fx-font-size: 80px;"); | |
Label label81 = new Label("Font size: 81px"); | |
label81.setStyle("-fx-font-size: 81px;"); | |
FlowPane rootPane = new FlowPane(Orientation.VERTICAL); | |
rootPane.setAlignment(Pos.CENTER); | |
rootPane.setStyle("-fx-background-color: WHITE;"); | |
rootPane.getChildren().addAll(label80, label81); | |
Scene scene = new Scene(rootPane); | |
stage.setTitle("JavaFX"); | |
stage.setScene(scene); | |
stage.show(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package jira37705; | |
import java.awt.Color; | |
import java.awt.Font; | |
import javax.swing.BoxLayout; | |
import javax.swing.JFrame; | |
import javax.swing.JLabel; | |
import javax.swing.WindowConstants; | |
public class MainSwing { | |
public static void main(String[] args) { | |
System.setProperty("awt.useSystemAAFontSettings","on"); | |
JLabel label80 = new JLabel("Text size: 80px"); | |
label80.setFont(new Font("System", Font.PLAIN, 80)); | |
JLabel label81 = new JLabel("Text size: 81px"); | |
label81.setFont(new Font("System", Font.PLAIN, 81)); | |
JFrame frame = new JFrame(); | |
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); | |
frame.setTitle("Java Swing"); | |
frame.getContentPane().setBackground(Color.WHITE); | |
frame.getContentPane().setLayout(new BoxLayout(frame.getContentPane(), BoxLayout.Y_AXIS)); | |
frame.getContentPane().add(label80); | |
frame.getContentPane().add(label81); | |
frame.pack(); | |
frame.setVisible(true); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment