19. Side Note - JSF is like the Flutter Stateful Widget
20. Archiving Color Theming
Java Swing
UIManager.put("nimbusBase", new Color(...));
UIManager.put("nimbusBlueGrey", new Color(...));
UIManager.put("control", new Color(...));
JavaFX uses separation of concerns - uses CSS Themes
52. Hello World
import javax.swing.*;
public class HelloWorld {
public static void main(String[] arguments) {
JLabel label = new JLabel("Hello World",
SwingConstants.CENTER);
JFrame.setDefaultLookAndFeelDecorated(tr
ue);
JFrame f = new JFrame("Hello World");
f.setSize(300, 150);
f.setDefaultCloseOperation(
JFrame.EXIT_ON_CLOSE);
f.add(label);
f.setVisible(true);
}
}
53. Common Layouts / Widgets / Components
● Common Layouts
○ Flutter has Row
○ Flutter has Column
○ GWT/Vaadin have Horizontal Layout
○ GWT/Vaadin have Vertical Layout
○ Swing has FlowLayout that could be
set to Panels
○ Android has LinearLayout
54. Weight
● Order in a flow
○ Flutter has Expanded
○ Java has Weight on Grid Bag Layed
out Component
55. Flex
● Flexed elements
○ Flutter has Flex Widget
○ Java Swing has GridBag Component
weight
○ Web has % or responsive Flex
Components
60. final JDialog dialog = new JDialog(frame,
"Click a button", true);
dialog.setContentPane(optionPane);
dialog.setDefaultCloseOperation(
JDialog.DO_NOTHING_ON_CLOSE);
dialog.addWindowListener(new
WindowAdapter() {
public void windowClosing(WindowEvent
we) {
setLabel("Thwarted user attempt to
close window.");
}
});
67. Java on the Desktop - MenuBar
// Create MenuBar
MenuBar menuBar = new MenuBar();
// Create menus
Menu fileMenu = new Menu("File");
Menu editMenu = new Menu("Edit");
Menu helpMenu = new Menu("Help");
// Create MenuItems
MenuItem newItem = new
MenuItem("New");
MenuItem openFileItem = new
MenuItem("Open File");
MenuItem exitItem = new MenuItem("Exit");
73. static final int FPS_MIN = 0;
static final int FPS_MAX = 30;
static final int FPS_INIT = 15; //initial frames
per second
. . .
JSlider framesPerSecond = new
JSlider(JSlider.HORIZONTAL,
FPS_MIN, FPS_MAX,
FPS_INIT);
framesPerSecond.addChangeListener(this);
//Turn on labels at major tick marks.
framesPerSecond.setMajorTickSpacing(10);
framesPerSecond.setMinorTickSpacing(1);
framesPerSecond.setPaintTicks(true);
framesPerSecond.setPaintLabels(true);
87. Java Web Integrations
I have a personal achievement of integration mix:
http://delc.fmi.uni-plovdiv.net/
Java Portlet, Grails Framework Back End with Ext JS Front-End
Portlet - with Struts 2 Framework with GWT calling the Ext JS
88. Navigation, Routing, Arguments
● Declarative - Navigation 2.0 ● Imperative - Supported in both
Java & Flutter
Passing Arguments Must Be
URL Encoded & Limited
Passing Arguments Could be
Anything