:ln !!! Listing 1 1 package de.steppan.app.rtex.main; 2 3 import javax.swing.UIManager; 4 import java.awt.*; 5 import de.steppan.app.rtex.view.AppWnd; 6 import de.steppan.lib.wnd.Alignment; // 3rd iteration 7 8 /** 9 * Title: RtexApp 10 * Description: Example for round-trip engineering with JBuilder & Together 11 * Copyright: Copyright (c) 2001 B. Steppan 12 * Company: C&N Touristic AG 13 * @author Bernhard Steppan 14 * @version 1.0 15 */ 16 17 public class RtexApp { 18 boolean packFrame = false; 19 20 /**Constructor*/ 21 public RtexApp() { 22 AppWnd appWnd = new AppWnd(); 23 // Detect frames => preferred size 24 if (packFrame) { 25 appWnd.pack(); 26 } 27 else { 28 appWnd.validate(); 29 } 30 appWnd.setSize(640,480); 31 appWnd.setAlignment(Alignment.centerOnScreen); // 3rd iteration 32 appWnd.setVisible(true); 33 } 34 35 /**Main operation*/ 36 public static void main(String[] args) { 37 try { // Try to set 'native' look & feel 38 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 39 } 40 catch(Exception e) { 41 e.printStackTrace(); 42 } 43 new RtexApp(); // Construct the app 44 } 45 } ------------------------------- !!! Listing 2 108 /**Show the install dialog (wizard)*/ 109 void showWizardDlg(ActionEvent e) { 110 WizardDlg wizardDlg = new WizardDlg(this, "Install Rtex -- Step 1", true); 111 wizardDlg.setAlignment(Alignment.centerOnParent); // 3rd iteration 112 wizardDlg.show(); // Show the dialog -------------------------------- !!! Listing 3 17 //public class WizardDlg extends JDialog { // 1st iteration 18 public class WizardDlg extends BasicDlg { // 3rd iteration 19 private int pageNumber = 1; // Counter for page navigation 20 21 JPanel dialogPnl; // Main UI panel 22 23 //Card layout container panel 24 JPanel contentPnl = new JPanel(); 25 CardLayout cardLayout = new CardLayout(); ------------------------------- !!! Listing 4 1 package de.steppan.app.rtex.view; 2 3 import java.awt.*; 4 import javax.swing.*; 5 6 /** 7 * Title: WelcomePnl 8 * Description: Example for round-trip engineering with JBuilder & Together 9 * Copyright: Copyright (c) 2001 10 * Company: C&N Touristic AG 11 * @author Bernhard Steppan 12 * @version 1.0 13 */ 14 15 public class WelcomePnl extends JPanel { 16 JLabel headText = new JLabel(); 17 JScrollPane textScrollPane = new JScrollPane(); 18 JTextArea welcomeText = new JTextArea(); 19 20 public WelcomePnl() { 21 try { 22 jbInit(); 23 } 24 catch(Exception ex) { 25 ex.printStackTrace(); 26 } 27 } 28 void jbInit() throws Exception { 29 this.setLayout(null); 30 this.add(headText, null); 31 this.add(textScrollPane, null); 32 headText.setText("Welcome to the installation of Rtex!"); 33 headText.setBounds(new Rectangle(10, 5, 400, 30)); 34 headText.setVerticalAlignment(SwingConstants.TOP); 35 // welcome text: 36 textScrollPane.setBounds(new Rectangle(10, 30, 400, 150)); 37 textScrollPane.getViewport().add(welcomeText, null); 38 welcomeText.setEditable(false); 39 welcomeText.setText("This program will install" 40 +"\nRtex on your computer." 41 +"\nClick 'Cancel' to quit this install program," 42 +"\nclick 'Next' to continue"); 43 } 44 } ------------------------------ !!! Listing 5 1 package de.steppan.app.rtex.view; 2 3 import java.awt.*; 4 import javax.swing.*; 5 6 /** 7 * Title: LicencePnl 8 * Description: Example for round-trip engineering with JBuilder & Together 9 * Copyright: Copyright (c) 2001 B. Steppan 10 * Company: C&N Touristic AG 11 * @author Bernhard Steppan 12 * @version 1.0 13 */ 14 15 public class LicencePnl extends JPanel { 16 JLabel bottomText = new JLabel(); 17 JLabel headText = new JLabel(); 18 JScrollPane textScrollPane = new JScrollPane(); 19 JTextArea licenceText = new JTextArea(); 20 21 public LicencePnl() { 22 try { 23 jbInit(); 24 } 25 catch(Exception ex) { 26 ex.printStackTrace(); 27 } 28 } 29 void jbInit() throws Exception { 30 this.setLayout(null); 31 this.add(headText, null); 32 this.add(bottomText, null); 33 this.add(textScrollPane, null); 34 headText.setBounds(new Rectangle(10, 5, 400, 30)); 35 headText.setText("Please read the following licence agreement carefully:"); 36 headText.setVerticalAlignment(SwingConstants.TOP); 37 // licence text: 38 textScrollPane.setBounds(new Rectangle(10, 30, 400, 150)); 39 textScrollPane.getViewport().add(licenceText, null); 40 licenceText.setEditable(false); 41 licenceText.setText("Your licence agreement"); 42 bottomText.setText("If you accept, press 'Yes', if not, press 'No'"); 43 bottomText.setBounds(new Rectangle(10, 200, 400, 30)); 44 } 45 } --------------------------------- 1 package de.steppan.app.rtex.view; 2 3 import java.awt.*; 4 import javax.swing.*; 5 6 /** 7 * Title: DirectoryPnl 8 * Description: Example for round-trip engineering with JBuilder & Together 9 * Copyright: Copyright (c) 2001 B. Steppan 10 * Company: C&N Touristic AG 11 * @author Bernhard Steppan 12 * @version 1.0 13 */ 14 15 public class DirectoryPnl extends JPanel { 16 JLabel headText = new JLabel(); 17 JTextField directoryTxf = new JTextField(); 18 JButton directoryBtn = new JButton(); 19 20 public DirectoryPnl() { 21 try { 22 jbInit(); 23 } 24 catch(Exception ex) { 25 ex.printStackTrace(); 26 } 27 } 28 void jbInit() throws Exception { 29 this.setLayout(null); 30 headText.setBounds(new Rectangle(10, 5, 400, 30)); 31 headText.setText("Please select the installation directory"); 32 headText.setVerticalAlignment(SwingConstants.TOP); 33 directoryTxf.setText("c:\\programme\\..."); 34 directoryTxf.setBounds(new Rectangle(10, 30, 360, 20)); 35 directoryBtn.setText("..."); 36 directoryBtn.setBounds(new Rectangle(380, 30, 30, 20)); 37 directoryBtn.setContentAreaFilled(true); 38 this.add(headText, null); 39 this.add(directoryTxf, null); 40 this.add(directoryBtn, null); 41 } 42 }