Ramen

Inhoud blog
  • emnTekstverbeteringTester :: Voorbereiding :: Deel 3
  • Opmaken van een spellinglijst : emnTekstverbeteringTester :: Voorbereiding
  • emnTekstverbeteringTester Deel 2
  • TekstverbeteringsTester emn :: deel 1 Voorbereiding
  • Open and close Stage and scene. Scenes stored in Hashmap
  • JavaFX FXML voorbeelden | JavaFX FXML examples
  • Eigenschappen voorbeeld uit vorig blog | Properties sample from previous blog
  • Meervoudige fxml bestanden laden | Loading multiple fxml files and controllers
  • Move from one object to another :: JavaFX
  • JavaFX templates
  • JavaFX FXML webbrowser
  • JavaFX ProgressIndicator - ProgessBar
  • Draai scene builder vanuit eclipse - Run scene builder from within eclipse.
  • FXML voorbeeld voor eclipse | FXML sample for eclipse
  • Wapenschild Hamerlinck
  • Wapenschild Hamerlinck
  • Zelf oefeningen maken :: educatie , talen , enquetes
  • ST. PATRICKS DAY PARADE
  • Hulp programma voor het leren van vreemde talen.
  • Javascript :: tekst sorteren op unieke woorden :: sort text
  • Code sorteer tekst : sort text :: javascript
  • onze tuin
  • Aston Ariel op bezoek
  • Hulpprogramma's :: Lezen | RSS - Nieuws
  • Presentationmodel :: buffered model :: RiverLayout
  • Make a separator for RiverLayout:
  • Customize combobox (binding JGoodies):: Riverlayout
  • Test Riverlayout :: sample
  • Project pw Helpdesk
  • LookAndFeel
  • JGoodies binding - RiverLayout
  • JGoodies binding and RiverLayout
  • Enkele JAVA gebonden afkortingen
  • Java Persistence with Hibernate
  • Exel : Woorden vervangen in tekst m.b..v een macro
  • Systray : verwijderen tags taakbalk. Wijzigingen start programma's
  • Scholier kraakt pornofilter van 50 miljoen euro
  • Items Kantorenproject
  • Minimumindeling van het algemeen rekeningstelsel
  • Items Java - eclipse
    Beoordeel dit blog
      Zeer goed
      Goed
      Voldoende
      Nog wat bijwerken
      Nog veel werk aan
     
    Foto
    Foto
    Foto

    rss nieuws

    Europa voor de meeste voorstanders meer en meer een grote teleurstelling
    Zoeken in blog


    Een kijk op....
    18-11-2013
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.JavaFX FXML webbrowser
    Klik op de afbeelding om de link te volgen

    JavaFX webbrowser :: WBstart.java + WBController.java + WBLayout.fxml
    Gebruikte gratis Programmas:
    Eclipse-standard-kepler-SR1-win32
    C:Program Files/Java/jre8

    Hulpprogramma:
    JavaFX Scene Builder"
    Dit is een GUI javaFX programma dat tevens ook een voorstel geeft voor de opbouw van je java controller bestand.

    Indien je een lagere jre versie wil gebruiken kijk dan na of deze de jfxrt.jar bevat voeg deze anders toe via:
    Eclipse >> Build pad / add external jars.

    Waar vind je de jfxrt.jar na het installeren van java op je PC?
    C:/program files/java/jdk1.7.0_45/jre/lib/jfxrt.jar
    C:/program files/java/jre7/lib/jfxrt.jar
    Used Free Programs:
    Eclipse-standard-kepler-SR1-win32
    C:Program Files/Java/jre8

    Helpprogram:
    JavaFX Scene Builder"
    A gui javaFX FXML-file buider that even generates a java controller file you can copy.

    If you are using an older jre version,than check if it contains the jfxrt.jar, else you will have to add it to you build path:
    Eclipse project >> Build pad / add external jars.

    Where can you find the jfxrt.jar after installing java on your PC?
    C:/program files/java/jdk1.7.0_45/jre/lib/jfxrt.jar
    C:/program files/java/jre7/lib/jfxrt.jar
    Programmas libres usados:
    Eclipse-standard-kepler-SR1-win32
    C:Program Files/Java/jre8

    Programma de ayuda:
    JavaFX Scene Builder"
    A JavaFX FXML-file constructor GUI que incluso genera un archivo de controlador de java (controller.java) que se puede copiar.

    Si está utilizando una versión anterior de JRE, el mejor es de comprobar si contiene la versión jfxrt.jar, si no, añadirla a su proyecto Eclipse:
    Eclipse project >> Build pad / add external jars.

    ¿Dónde está el archivo "jfxrt.jar" en su PC después de instalar java?
    C:/program files/java/jdk1.7.0_45/jre/lib/jfxrt.jar
    C:/program files/java/jre7/lib/jfxrt.jar
    Project files

    1. Start.java
    ----------
    package fxml.brauwser;

    import javafx.application.Application;
    import javafx.fxml.FXMLLoader;
    import javafx.scene.Parent;
    import javafx.scene.Scene;
    import javafx.stage.Stage;


    public class WBstart extends Application{
    public static void main(String[] args) {
    Application.launch(args);
    }

    public void start(Stage stage) throws Exception {
    Parent root = (Parent) FXMLLoader.load(getClass().getResource("WBLayout.fxml"));
    stage.setTitle("FXML pwBrauwser");
    stage.setScene(new Scene(root, 800, 600));
    stage.show();

    }
    }


    2. WBController.java
    -----------------
    package fxml.brauwser;

    import javafx.concurrent.Worker.State;

    import java.net.URL;
    import java.util.ResourceBundle;

    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.event.ActionEvent;
    import javafx.fxml.FXML;
    import javafx.scene.control.Button;
    import javafx.scene.control.Label;
    import javafx.scene.control.MenuButton;
    import javafx.scene.control.ProgressIndicator;
    import javafx.scene.control.TextField;
    import javafx.scene.input.InputMethodEvent;
    import javafx.scene.layout.HBox;
    import javafx.scene.web.WebEngine;
    import javafx.scene.web.WebView;


    public class WBController {
    @FXML
    private WebEngine webEngine;

    @FXML
    private ResourceBundle resources;

    @FXML
    private URL location;

    @FXML
    private HBox titelbalk;

    @FXML
    private HBox titelhouder; //bevat titellabel gekonfigureerd in het fxml bestand en statelabel

    @FXML Label statelabel;

    @FXML
    private HBox keuzeknophouder;//bevat progressindicator menubutton

    @FXML
    ProgressIndicator pi = new ProgressIndicator();
    @FXML
    private MenuButton menuadressen;

    @FXML
    private HBox adres_knoppen_balk; // bevat adres houder en aksieknoppen(bevelknoppen)

    @FXML
    private HBox adresveldhouder;
    @FXML
    private TextField adresveld;

    @FXML
    private HBox bevelhouder;
    @FXML
    private Button ververs;
    @FXML
    private Button volgend;
    @FXML
    private Button vorig;
    @FXML
    private Button vuur;

    @FXML
    private HBox webzichthouder;

    @FXML
    private WebView webzicht;



    @FXML
    void aksie_ververs(ActionEvent event) {
    webEngine.reload();
    }

    @FXML
    void vuur_adres_af(ActionEvent event) {
    //webzicht = new WebView();

    webEngine.load(adresveld.getText());
    webEngine.getLoadWorker().stateProperty().addListener(
    new ChangeListener<State>() {
    public void changed(ObservableValue<? extends State> arg0,
    State arg1, State arg2) {

    statelabel.setText("State: "+arg2.toString());
    //arg0 :: bean/name/value
    //arg2 :: value
    }
    });
    webEngine.getLoadWorker().progressProperty().addListener(new ChangeListener<Object>(){

    @Override
    public void changed(ObservableValue<?> arg0, Object arg1, Object arg2) {
    pi.setProgress((Double) arg0.getValue());
    }
    });
    webEngine.locationProperty().addListener(new ChangeListener<String>() {
    @Override public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
    adresveld.setText(newValue);
    }
    });
    adresveld.setText(webEngine.getLocation());
    }

    @FXML
    void vuur_volgend_adres_af(ActionEvent event) {
    webEngine.executeScript("history.forward()");
    }

    @FXML
    void vuur_vorig_adres_af(ActionEvent event) {
    webEngine.executeScript("history.back()");
    }


    @FXML
    void aksie_adresveld_onenterpressed(ActionEvent event) {
    vuur_adres_af(event);
    }

    @FXML
    void aksie_kies_website(ActionEvent event) {
    System.out.println("OPen aksie");
    System.out.println("tekst"+menuadressen.getItems().get(0).getText()+"::"+menuadressen.getItems().get(1).getText());
    if(menuadressen.getText().equals("item01")){
    System.out.println("OPen website synoniemen");
    }
    }
    @FXML
    void aksie_kies_menuitem(ActionEvent event) {
    //Kode voor menubutton hier
    System.out.println("tekst items: "+menuadressen.getItems().get(0).getText()+"::"+menuadressen.getItems().get(1).getText());

    }


    @FXML
    void initialize() {

    webEngine = webzicht.getEngine();

    }

    }


    3. BWLayout.fxml
    -------------
    <?xml version="1.0" encoding="UTF-8"?>

    <?import java.lang.*?>
    <?import java.util.*?>
    <?import javafx.scene.control.*?>
    <?import javafx.scene.effect.*?>
    <?import javafx.scene.layout.*?>
    <?import javafx.scene.paint.*?>
    <?import javafx.scene.text.*?>
    <?import javafx.scene.web.*?>


    <AnchorPane id="AnchorPane" style="-fx-background-color: gray;" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="536.0" prefWidth="692.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/2.2" fx:controller="fxml.brauwser.WBController">
    <children>
    <HBox id="css_titelbalk" fx:id="titelbalk" alignment="CENTER" layoutY="4.0" prefHeight="30.0" prefWidth="663.0" spacing="5.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="15.0">
    <children>
    <HBox alignment="CENTER_LEFT" prefHeight="30.0" prefWidth="337.0" spacing="5.0" HBox.hgrow="ALWAYS">
    <children>
    <Label prefWidth="496.0" text="pwWebBrauwser" HBox.hgrow="ALWAYS">
    <font>
    <Font name="Arial" size="18.0"/>
    </font>
    </Label>
    <Label id="css_statelabel" fx:id="statelabel" prefWidth="150.0" text="State: " />
    </children>
    </HBox>
    <HBox id="css_keuzeknophouder" fx:id="keuzeknophouder" alignment="CENTER_RIGHT" prefHeight="30.0" prefWidth="210.0" spacing="5.0">
    <children>
    <ProgressIndicator id="css_pi" fx:id="pi" prefHeight="55.0" prefWidth="55.0" progress="0.0" />
    <MenuButton id="css_menuadressen" fx:id="menuadressen" contentDisplay="CENTER" mnemonicParsing="false" onAction="#aksie_kies_website" prefHeight="30.0" prefWidth="162.0" text="WebAdressen" HBox.hgrow="NEVER">
    <items>
    <MenuItem id="item01" mnemonicParsing="false" onAction="#aksie_kies_menuitem" text="Synos" />
    <MenuItem id="item02" mnemonicParsing="false" text="Rijmen" />
    </items>
    </MenuButton>
    </children>
    </HBox>
    </children>
    </HBox>
    <HBox id="css_adres_knoppen_balk" fx:id="adres_knoppen_balk" alignment="CENTER_RIGHT" layoutY="34.0" prefHeight="30.0" prefWidth="663.0" spacing="5.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="15.0">
    <children>
    <HBox id="css_adresveldhouder" fx:id="adresveldhouder" alignment="CENTER_LEFT" prefHeight="21.0" prefWidth="565.0" spacing="5.0" HBox.hgrow="ALWAYS">
    <children>
    <TextField id="css_adresveld" fx:id="adresveld" alignment="CENTER_LEFT" prefWidth="508.0" onAction="#aksie_adresveld_onenterpressed" text="http://www.google.es" HBox.hgrow="ALWAYS" />
    </children>
    </HBox>
    <HBox id="css_bevelhouder" fx:id="bevelhouder" alignment="CENTER" minWidth="86.0" prefWidth="160.0" spacing="5.0">
    <children>
    <Button id="css_vuur" fx:id="vuur" mnemonicParsing="false" onAction="#vuur_adres_af" text="Vuur" />
    <Button id="css_vorige" fx:id="vorig" mnemonicParsing="false" onAction="#vuur_vorig_adres_af" text="&lt;" />
    <Button id="css_volgende" fx:id="volgend" mnemonicParsing="false" onAction="#vuur_volgend_adres_af" text="&gt;" />
    <Button id="css_ververs" fx:id="ververs" mnemonicParsing="false" onAction="#aksie_ververs" text="VV" />
    </children>
    </HBox>
    </children>
    </HBox>
    <HBox id="css_webzichthouder" fx:id="webzichthouder" prefHeight="463.0" prefWidth="692.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="73.0">
    <children>
    <WebView fx:id="webzicht" prefHeight="471.0" prefWidth="617.0" HBox.hgrow="ALWAYS" />
    </children>
    </HBox>
    </children>
    </AnchorPane>

     

    18-11-2013 om 00:00 geschreven door de makers


    Tags:JavaFX Webview webengine controller FXML webbrowser
    » Reageer (0)
    16-11-2013
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.JavaFX ProgressIndicator - ProgessBar


    JavaFX : voeg een ProgressIndicator of ProgessBar toe.
    JavaFX : add a ProgressIndicator or a ProgressBar.
    JavaFX: añadir un ProgressIndicator o ProgessBar.

    prog:

    eclipse-standard-kepler-SR1-win32
    Java :: jre7 (or/of 8) (external jar for jre7 :: C:Program Files/Java/jre7/lib/jfxrt.jar)



    Voorbeeld | Example | Ejemplo
      
      ProgressIndicator pi = new ProgressIndicator();
        ProgressBar pb = new ProgressBar();
        ...
        ...
        ...

        public WebBrowser() {
            rootvbox = new VBox();
            webView = new WebView();
            pi.setMinSize(40, 40);
            pb.setMaxWidth(webView.getMaxWidth());
            
            final WebEngine webEngine = webView.getEngine();
            webEngine.load(Start_URL);
            webEngine.getLoadWorker().progressProperty().addListener(new ChangeListener<Object>(){
           
    @Override
    public void changed(ObservableValue<?> arg0, Object arg1, Object arg2) {

    pi.setProgress((Double) arg0.getValue());
    pb.setProgress((Double) arg0.getValue());
    //OR:
    //pi.setProgress(webEngine.getLoadWorker().getProgress());
    //pb.setProgress(webEngine.getLoadWorker().getProgress());
    System.out.println("Progress"+webEngine.getLoadWorker().getProgress()*100);
    System.out.println("Value arg0 (=arg2): "+(Double)arg0.getValue()*100);
    System.out.println("End value prev check :: arg1: "+(Double)arg1*100);
    System.out.println("End value ckeck :: arg2 :"+(Double)arg2*100);
    }
    });
            final TextField locationField = new TextField(Start_URL);
    ...
    ...
    ...
    }

    16-11-2013 om 00:00 geschreven door de makers


    Tags:javaFX sample example ejemplo ProgressIndicator of ProgessBar
    » Reageer (0)
    15-11-2013
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.Draai scene builder vanuit eclipse - Run scene builder from within eclipse.
    FXML - bestand draaien met Oracle scene builder vanuit eclipse.
    Run an FXML file with Oracle scene builder from within eclipse.

    Program / Programmas:

    eclipse-standard-kepler-SR1-win32
    Java :: jre7 (or/of 8)

    Metode 1:


    Rechter muisklik het fxml bestand in je eclipseprojekt> "open with" :: kies: System Editor

    Right mouseclick the fxml file in your eclipseproject> "open with" :: chose: System Editor

    Haga clic derecho en el archivo fxml en el Proyecto Eclipse > "open with" :: selecciona: System Editor 

    or

    Metode 2:
    Rechter muisklik het fxml bestand in je eclipseprojekt> "open with" > "other" .
    Right mouseclick the fxml file in your eclipseproject>               "                     ".
    Selekteer in het keuzevenster "external programs"
    Select in the editor selection window  "         "  .
    Indien javafx scene builder zich niet in de lijst bevindt zoek dan het programma via de "Browse" knop.
    If the desired program is not listed in the proposed list use the 'Brouwse" button to select it.
    Na het aanduiden van het programma zet eclipse dit bij onderaan de lijst van external programs.
    After selecting it, eclipse will add the program at the end of the selectionlist.
    klik het progamma aan en druk ok.
    Click on it and press the ok button.


    Noot:
    - Scene builder heeft wel zijn tijd nodig om op te laden.
    - Scene builder needs it s time to load.
    - Bij veranderingen in je fxml bestand zal scene builder je bestand updaten in je eclipse projekt bij een bewaaropdracht.
    - By changes on the fxml file Scene builder will opdate your file in the elipse project by the command to save it.
    - Je sluit de screne builder(1.1) best af als je hem even niet meer gebruikt?
     (De mogelijk bestaat dat het programma na een tijd niet meer reageert of dat het een tijd duurt vooraleer het weer aktief wordt.






    15-11-2013 om 00:00 geschreven door de makers


    Tags:opescene builder with eclipse, Using Scene Builder with Eclipse
    » Reageer (0)
    12-11-2013
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.FXML voorbeeld voor eclipse | FXML sample for eclipse
    FXML voorbeeld voor eclipse | FXML sample  for eclipse

    Nodig voor ons voorbeeld:

    1: maak een package map aan in uw projekt

    bvb: map eclipse

    2: maak 2 java class bestanden (2 java class files) + 1 fxml bestand (1 fxml file)

    bvb:  MenEditor.java (start-bestand(-file), MenControler.java , menlayout.fxml

    a: Code MenEditor.java  

    package eclipse;

    import javafx.application.Application;
    import javafx.fxml.FXMLLoader;
    import javafx.scene.Parent;
    import javafx.scene.Scene;
    import javafx.stage.Stage;

    /**
    *
    * @author pw
    */
    public class MenEditor extends Application {
       
       @Override
       public void start(Stage stage) throws Exception {
           Parent root = FXMLLoader.load(getClass().getResource("menlayout.fxml"));
           
           Scene scene = new Scene(root);
           
           stage.setScene(scene);
           stage.show();
       }

        /**
          * Met de main() method word geen rekening gehouden in een goed 
          * samengestelde JavaFX toepassing.
          * main() is bedoeld als terugval in het geval dat de toepassing
          * ten gevolge van het gebruik van e.d. in IDEs met beperkte FX
          * ondersteuning.
          */


       public static void main(String[] args) {
           launch(args);
       }
       
    }

    b: MenController.java

    package eclipse;

    import java.net.URL;
    import java.util.ResourceBundle;
    import javafx.event.ActionEvent;
    import javafx.fxml.FXML;
    import javafx.scene.control.Button;
    import javafx.scene.control.MenuButton;
    import javafx.scene.control.ProgressIndicator;
    import javafx.scene.control.Tab;
    import javafx.scene.control.TabPane;
    import javafx.scene.control.TextArea;
    import javafx.scene.input.InputMethodEvent;
    import javafx.scene.input.KeyEvent;
    import javafx.scene.layout.AnchorPane;
    import javafx.scene.layout.HBox;
    import javafx.scene.web.HTMLEditor;
    import javafx.scene.web.WebView;


    public class MenController {

       @FXML
       private ResourceBundle resources;

       @FXML
       private URL location;

       @FXML
       private HTMLEditor editorraam;

       @FXML
       private AnchorPane hoofdanchorpane;

       @FXML
       private TabPane hoofdtabpane;

       @FXML
       private MenuButton keuzelijst;

       @FXML
       private HBox men_hboxbuttons;

       @FXML
       private AnchorPane menanchorpane;

       @FXML
       private TextArea menraam;

       @FXML
       private ProgressIndicator progressindicator;

       @FXML
       private Tab tabbrowser;

       @FXML
       private Tab tabhtml;

       @FXML
       private Tab tabmen;

       @FXML
       private Button verzendknop;

       @FXML
       private Button volgendeknop;

       @FXML
       private Button vorigeknop;

       @FXML
       private WebView webbrowserraam;


       @FXML
       void onkeypressedAksie(KeyEvent event) {
        System.out.println("toets ingedrukt");
       }

       @FXML
       void onkeyreleasedAksie(KeyEvent event) {
        System.out.println("toets gelost");
       }

       @FXML
       void onkeytypedAksie(KeyEvent event) {
        System.out.println("toest gebruikt");
       }

       @FXML
       void ontextchangeAksie(InputMethodEvent event) {
        System.out.println("tekst aangepast");
       }

       @FXML
       void verzendaksie(ActionEvent event) {
       }

       @FXML
       void volgendeaksie(ActionEvent event) {
       }

       @FXML
       void vorigeaksie(ActionEvent event) {
       }

       @FXML
       void initialize() {

       }

    }

    Dit bestand werd gecopieerd vanuit Oracle Scene builder via menu view > Show sample controller skeleton(zie foto)
    We have copied this file from the Oracle Scene Builder menu : view > Show sample controller skeleton(see pic)

    c: menlayout.fxml

    <?xml version="1.0" encoding="UTF-8"?>

    <?import java.lang.*?>
    <?import java.util.*?>
    <?import javafx.scene.control.*?>
    <?import javafx.scene.layout.*?>
    <?import javafx.scene.paint.*?>
    <?import javafx.scene.text.*?>
    <?import javafx.scene.web.*?>
    <?scenebuilder-background-color 0xdfdfdfff?>

    <AnchorPane id="AnchorPane" fx:id="hoofdanchorpane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" m
      <children>
        <ProgressIndicator id="progressindic" fx:id="progressindicator" layoutX="557.0" layoutY="23.0" progress="0.0" />
        <TabPane fx:id="hoofdtabpane" prefHeight="323.0" prefWidth="572.0" tabClosingPolicy="UNAVAILABLE" AnchorPane.bottomAnchor="14.0" AnchorPane.leftAnchor="14.0" AnchorPane.rightAnchor="14.0" AnchorPane.topAnchor="63.0">
          <tabs>
            <Tab fx:id="tabmen" text="MEN-Editor">
              <content>
                <AnchorPane id="Content" fx:id="menanchorpane" minHeight="0.0" minWidth="0.0" prefHeight="262.0" prefWidth="572.0">
                  <children>
                    <TextArea id="Editor" fx:id="menraam" onKeyPressed="#onkeypressedAksie" onKeyReleased="#onkeyreleasedAksie" onKeyTyped="#onkeytypedAksie" prefHeight="268.0" prefWidth="572.0" style="-fx-font: 18px "Book Antiqua"; -fx-padding: 10;" text="" wrapText="true" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="24.0" />
                    <HBox id="HBox" fx:id="men_hboxbuttons" alignment="CENTER" layoutY="3.0" spacing="5.0" AnchorPane.rightAnchor="8.0">
                      <children>
                        <Button mnemonicParsing="false" text="Button" />
                        <Button mnemonicParsing="false" text="Button" />
                        <Button mnemonicParsing="false" text="Button" />
                      </children>
                    </HBox>
                  </children>
                </AnchorPane>
              </content>
            </Tab>
            <Tab fx:id="tabhtml" text="HTML-Editor">
              <content>
                <AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
                  <children>
                    <HTMLEditor id="htmlEditor" fx:id="editorraam" htmlText="<html><head></head><body contenteditable="true"></body></html>" onInputMethodTextChanged="#ontextchangeAksie" onKeyPressed="#onkeypressedAksie" onKeyReleased="#onkeyreleasedAksie" onKeyTyped="#onkeytypedAksie" prefHeight="271.0" prefWidth="572.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0" />
                  </children>
                </AnchorPane>
              </content>
            </Tab>
            <Tab fx:id="tabbrowser" text="WebBrowser">
              <content>
                <AnchorPane id="Content" minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0">
                  <children>
                    <WebView id="pwWebBrowser" fx:id="webbrowserraam" prefHeight="252.0" prefWidth="572.0" AnchorPane.bottomAnchor="6.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="34.0" />
                    <HBox id="HBox" alignment="CENTER" layoutY="4.0" prefWidth="558.0" spacing="5.0" AnchorPane.rightAnchor="8.0">
                      <children>
                        <TextField prefWidth="355.0" text="http://www.google.nl" HBox.hgrow="ALWAYS" />
                        <Button id="verzendknopAksie" fx:id="verzendknop" mnemonicParsing="false" onAction="#verzendaksie" text="Verzend" />
                        <Button id="vorigeAksie" fx:id="vorigeknop" mnemonicParsing="false" onAction="#vorigeaksie" text="Vorige" />
                        <Button id="volgendeaksie" fx:id="volgendeknop" mnemonicParsing="false" onAction="#volgendeaksie" text="Volgende" />
                      </children>
                    </HBox>
                  </children>
                </AnchorPane>
              </content>
            </Tab>
          </tabs>
        </TabPane>
        <Text fill="#606060" layoutX="29.0" layoutY="30.0" scaleX="1.3934224560051214" scaleY="1.0" strokeType="OUTSIDE" strokeWidth="0.0" text="pwMenEditor">
          <font>
            <Font name="System Bold" size="12.0" />
          </font>
        </Text>
        <MenuButton fx:id="keuzelijst" layoutY="25.0" mnemonicParsing="false" text="Keuzelijst" AnchorPane.rightAnchor="51.0">
          <items>
            <MenuItem mnemonicParsing="false" text="Action 1" />
            <MenuItem mnemonicParsing="false" text="Action 2" />
          </items>
        </MenuButton>
      </children>
    </AnchorPane>


    Dit bestand werd aangemaakt met Oracle Scene Builder
    Made with Oracle Scene builder (1.1)

    Noot:
    Aan het einde van de eerste itemkonfigurasie zie je hoe de lokasie van the kontroler wordt weeergegeven:
    fx:controller="eclipse.MenController">
    Gebruik dus een punt en geen schuine streep om de package-map en de bestandsnaam aan te geven.
          
    De nieuwere testversie van scene builder vinden wij minder aangenaam om mee te werken. Er zijn ook taalproblemen mee: gebruik van verschillende talen door mekaar.


    Programmas:
    eclipse-standard-kepler-SR1-win32
    C:Program FilesJavajre8

    Hulpprogramma : JavaFX Scene Builder
    gratis download = <a href="http://www.oracle.com/technetwork/java/javafx/tools/index.html">Scene Builder";


    indien je een lagere jre versie wil gebruiken kijk dan na of deze de jfxrt.jar bevat
    voeg deze anders toe via:

    Build pad / add external jars.
    C:/program files/java/jdk1.7.0_45/jre/lib/jfxrt.jar

    Eclipse FXML sample example
    Eclipse FXML controller
    Eclipse FXML file

    Eclipse FXML voorbeeld
    Eclipse FXML controller
    Eclipse FXML bestand




    12-11-2013 om 16:19 geschreven door de makers


    Tags:FXML EXAMPLE ECLIPSE Controller
    » Reageer (0)
    07-07-2011
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.Wapenschild Hamerlinck
    Klik op de afbeelding om de link te volgen

    Wapenschild Hamerlinck

     














    07-07-2011 om 05:53 geschreven door de makers


    » Reageer (0)
    06-07-2011
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.Wapenschild Hamerlinck
    Klik op de afbeelding om de link te volgen

    Family Crest,Coat of Arms

     

    Familiewapen  Familie Hamerlinck

     

    Heraldiek

    06-07-2011 om 00:00 geschreven door de makers


    Tags:heraldiek, wapenschild
    » Reageer (0)
    17-11-2009
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.Zelf oefeningen maken :: educatie , talen , enquetes
    Zelf oefeningen maken :: invuloefeningen , multiple choise , radio buttons , combobox.

    Zelf invuloefeningen of multiple choice oefenningen maken op een eenvoudige manier.

    Structuur en voorbeeldvideo

    Link naar de oefening - formmaker

    Kan gebruikt worden voor talen , quizvragen , algemene kennis.

    17-11-2009 om 00:00 geschreven door de makers


    » Reageer (0)
    19-03-2009
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.ST. PATRICKS DAY PARADE


    ST. PATRICKS DAY PARADE 2009

    Free speech is sacred

    19-03-2009 om 14:56 geschreven door de makers


    » Reageer (1)
    18-02-2009
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.Hulp programma voor het leren van vreemde talen.
    Leren lezen, sneller leren lezen, woordenschat verrijken, gezegden en spreekwoorden bijwerken, in de eigen taal of bij het aanleren van een vreemde taal.
    Een handig hulpmiddel om dit doel te bereiken wordt geboden door het volgende html-javascript gereedschap.

    Klik hier voor een voorbeeld van voorgeprogrammeerde oefeningen: Voorgeprogrameerde oefeningen

    Code:


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">

    <HTML>
    <HEAD>
       
        <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
        <TITLE></TITLE>
        <META NAME="GENERATOR" CONTENT="OpenOffice.org 3.0  (Win32)">
        <META NAME="AUTHOR" CONTENT="piet willems">
        <META NAME="CREATED" CONTENT="17-02-2009">
        <META NAME="CHANGED" CONTENT="0;0">
    <style>


    .mini{font-family:Tahoma; font-size:7pt;text-spacing:-1px;line-height:90%}
    .display{font-size:26 ;font-family:Arial; font-weight : bold;text-align: center}
    </style>

    <script language=javascript>


    var randomnr;
    var timerboolean = false;
    var teller = null;
    var x=0,t=1;
    var ingave;
    var woordenschat;
    var tijd,t;
    var max;
    var aantalzinnen=0;


    function Initieergeordend(oef)
    {

    ingave = document.getElementById('bron').value;
        
        woordenschat =document.getElementById('bron').value;
        woordenschat=woordenschat.split(".");
           
        tijd = document.getElementById('leesduur').value;
        max= woordenschat.length;
        document.getElementById('aantalzinnentekst').value = max;
        aantalzinnen = document.getElementById('duuroefening').value; //100
        if(timerboolean)
            {
            clearTimeout(teller);
            timerboolean = false;
            }
        if (aantalzinnen==0)
            {
            StopTheClock();
            alert("Einde van de oefening.");
            }
        else
            {
            aantalzinnen = aantalzinnen - 1;
            timerboolean = true;

            document.getElementById('displaycell').innerHTML=woordenschat[x];
            t = woordenschat[x].length;
            x=x+1;
            document.getElementById('duuroefening').value=aantalzinnen;
            tijd = tijd*t;
            document.getElementById('berekendeleestijd').value=tijd;
            teller = self.setTimeout("Initieergeordend()", tijd);
        }
    }


    function Initieerwillekeurig()
    {

    ingave = document.getElementById('bron').value;
     

        
        woordenschat =document.getElementById('bron').value;
        woordenschat=woordenschat.split(".");
        tijd = document.getElementById('leesduur').value;
        max= woordenschat.length;
        document.getElementById('aantalzinnentekst').value = max;
        aantalzinnen = document.getElementById('duuroefening').value; //100
        
        if(timerboolean)
            {
            clearTimeout(teller);
            timerboolean = false;
            }
        if (aantalzinnen==0)
            {
            StopTheClock();
            alert("Einde van de oefening.");
            }
        else
            {
            aantalzinnen = aantalzinnen - 1;
            timerboolean = true;
            randomnr = Math.random();
            document.getElementById('displaycell').innerHTML=woordenschat[Math.ceil(randomnr*max)-1];
            t = woordenschat[Math.ceil(randomnr*max)-1].length;    
            document.getElementById('duuroefening').value=aantalzinnen;
            tijd = tijd*t;
            document.getElementById('berekendeleestijd').value=tijd;
            teller = self.setTimeout("Initieerwillekeurig()", tijd);
        }
    }


    function StopTheClock()
    {
        if(timerboolean)
        {
               clearTimeout(teller);
            timerboolean = false;
        }
        location.reload(true);
    //alert("Einde van de oefening.")
    }

    function LaadOef1()
    {
    document.getElementById('bron').value=document.getElementById('oef1').value;
    }

    function LaadOef2()
    {
    document.getElementById('bron').value=document.getElementById('oef2').value;
    }

    function LaadOef3()
    {
    document.getElementById('bron').value=document.getElementById('oef3').value;
    }

    function LaadOef4()
    {
    document.getElementById('bron').value=document.getElementById('oef4').value;
    }

    function LaadOef5()
    {
    document.getElementById('bron').value=document.getElementById('oef5').value;
    }

    function LaadOef6()
    {
    document.getElementById('bron').value=document.getElementById('oef6').value;
    }

    function laadinstructies()
    {
    document.getElementById('bron').value="Plak hier uw tekst of gebruik één van onderstaande knoppen die een voorbeeldtekst laden.rNieuwe tekst laden:rdruk Stop | druk Reset | plak nieuwe tekst | Start geordend/willekeurig";
    }
        
    </script>       

    </head>

    <body onload=laadinstructies()>

    <table border="0" width="100%">
        <tr>
            <td bgcolor="#3C0000" style="border: 1px solid #000000; ">
    <b>
    <font face="Arial" color="#FFFFFF">Oefen- en Hulpgereedschap : Leren lezen in
    een vreemde taal. Leer uw woordenschat : Leer gezegden en uitdrukkingen.</font></b></td>
        </tr>
        <tr>
            <td id="displaycell" class="display" height="151" style="border: 1px solid #C0C0C0">
            </td>
        </tr>
        <tr>
            <td></td>
        </tr>
    </table>
    <table border="0" width="100%" style="border: 1px solid #6C3600" bgcolor="#FF8C1A">
        <tr>
            <td width="81" valign="bottom">
            <input type="button" value="Start geordend" name="B4" onclick=Initieergeordend()></td>
            <td width="81" valign="bottom">
            <input type="button" value="Start willekeurig" name="B7" onclick=Initieerwillekeurig()></td>
            <td width="56" valign="bottom">
            <input type="button" value="Stop" name="B5" onclick=(StopTheClock())></td>
            <td width="166" valign="bottom">
            <b>
            <font face="Arial" size="1">Aantal keer oefenen </font>
            </b>
            <input id="duuroefening" value="10" size="6" name="duuroefening"></td>
            <td width="117" valign="bottom">
            <p align="left"><b><font face="Arial" size="1">Leestijd </font>
            </b>
            <input id="leesduur" value="70" size="6" name="leesduur"></td>
            <td valign="bottom" width="132"><font size="1" face="Arial">Aantal
            zinnen in de tekst</font></td>
            <td valign="bottom" width="63">
             <!--webbot bot="Validation" s-data-type="Number" s-number-separators="x," --><input id="aantalzinnentekst" value="0" size="6" name="randomkeuze" style="border: 1px solid #800000"></td>
            <td valign="bottom" width="115">
            <p align="right"><font size="1" face="Arial">Berekende  leestijd :</font></td>
            <td valign="bottom">
             <!--webbot bot="Validation" s-data-type="Number" s-number-separators="x," --><input id="berekendeleestijd" size="6" name="randomkeuze0" style="border: 1px solid #800000"></td>
        </tr>
    </table>
    <table border="0" width="100%" cellspacing="5" style="border-left-style: solid; border-left-width: 1px; border-right-style: solid; border-right-width: 1px; border-top-width: 1px; border-bottom-style: solid; border-bottom-width: 1px">
        <tr>
            <td>
            <input type="button" value="Moeilijke woorden" name="B12" onclick=LaadOef1()></td>
            <td>
            <input type="button" value="Spreekwoorden A" name="B13" onclick=LaadOef2()></td>
            <td>
            <input type="button" value="Leesoef. 1" name="B14" onclick=LaadOef3()></td>
            <td>
            <input type="button" value="Leesoef.2" name="B15" onclick=LaadOef4()></td>
            <td>
            <input type="button" value="Leesoef.3" name="B16" onclick=LaadOef5()></td>
            <td>
            <input type="button" value="Leesoef.4" name="B17" onclick=LaadOef6()></td>
            </table>
    <p> </p>
    <p align="center"><font face="Arial">
                    <textarea rows="10" name="S7" cols="91" id="bron" style="border: 1px solid #510000; ">
                    </textarea></font></p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <form method="POST">
    <TABLE height="255" width="100%" cellspacing="0" >
            <TR>
                <TD HEIGHT=19 ALIGN=LEFT bgcolor="#3C0000"><b>
                <font face="Arial" size="2" color="#FFFFFF">Data Oefeningen</font></b></TD>
            </TR>
            <TR>
                <TD HEIGHT=230 ALIGN=LEFT>
                <p><font face="Arial">
                   
    <textarea rows="10" name="S1" cols="30" id="oef1" style="border: 1px solid #510000; ">

    PLAK HIER DE TEKST VOOR OEFENING 1. OPGELET : VERGEET HET "PUNT"-LEESTEKEN NIET. DIT TEKEN WORDT GEBRUIKT OM DE ZINNEN TE SCHEIDEN.
    Nadien deze code opslaan als "uwnaam.html", dus als een html-bestand.

    </textarea>

    <textarea rows="10" name="S3" cols="30" id="oef3" style="border: 1px solid #510000; ">

    PLAK HIER DE TEKST VOOR OEFENING 2. OPGELET : VERGEET HET "PUNT"-LEESTEKEN NIET. DIT TEKEN WORDT GEBRUIKT OM DE ZINNEN TE SCHEIDEN.
    Nadien deze code opslaan als "uwnaam.html", dus als een html-bestand.


    </textarea><br>

    <textarea rows="10" name="S3" cols="30" id="oef3" style="border: 1px solid #510000; ">

    PLAK HIER DE TEKST VOOR OEFENING 3. OPGELET : VERGEET HET "PUNT"-LEESTEKEN NIET. DIT TEKEN WORDT GEBRUIKT OM DE ZINNEN TE SCHEIDEN.
    Nadien deze code opslaan als "uwnaam.html", dus als een html-bestand.


    </textarea><br>

    <textarea rows="10" name="S4" cols="30" id="oef4" style="border: 1px solid #510000; ">

    PLAK HIER DE TEKST VOOR DE OEFENING 4. OPGELET : VERGEET HET "PUNT"-LEESTEKEN NIET. DIT TEKEN WORDT GEBRUIKT OM DE ZINNEN TE SCHEIDEN.
    Nadien deze code opslaan als "uwnaam.html", dus als een html-bestand.


    </textarea>

    <textarea rows="10" name="S5" cols="30" id="oef5" style="border: 1px solid #510000; ">

    PLAK HIER DE TEKST VOOR OEFENING 5. OPGELET : VERGEET HET "PUNT"-LEESTEKEN NIET. DIT TEKEN WORDT GEBRUIKT OM DE ZINNEN TE SCHEIDEN.
    Nadien deze code opslaan als "uwnaam.html", dus als een html-bestand.


    </textarea>

    <textarea rows="10" name="S6" cols="30" id="oef6" style="border: 1px solid #510000; ">

    PLAK HIER DE TEKST VOOR OEFENING 6. OPGELET : VERGEET HET "PUNT"-LEESTEKEN NIET. DIT TEKEN WORDT GEBRUIKT OM DE ZINNEN TE SCHEIDEN.
    Nadien deze code opslaan als "uwnaam.html", dus als een html-bestand.


    </textarea></font></p>
                    
                </TD>
            </TR>
            </TABLE>
            
    <TABLE height="18" width="100%" cellspacing="0" >
            <TR>
                <TD HEIGHT=18 ALIGN=LEFT bgcolor="#3C0000">
                <p align="center">
                    </TD>
            </TR>
    </TABLE>
    </form>

    </body>

    </html>


    Klik hier voor een voorbeeld van : Copy en past voorbeeld

    Code:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">

    <HTML>
    <HEAD>
       
        <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
        <TITLE></TITLE>
        <META NAME="GENERATOR" CONTENT="OpenOffice.org 3.0  (Win32)">
        <META NAME="AUTHOR" CONTENT="piet willems">
        <META NAME="CREATED" CONTENT="17-02-2009">
        <META NAME="CHANGED" CONTENT="0;0">
    <style>


    .mini{font-family:Tahoma; font-size:7pt;text-spacing:-1px;line-height:90%}
    .display{font-size:26 ;font-family:Arial; font-weight : bold;text-align: center}
    </style>

    <script language=javascript>


    var randomnr;
    var timerboolean = false;
    var teller = null;
    var x=0,t=1;
    var ingave;
    var woordenschat;
    var tijd;
    var irish = "An Irish Tale.As I returned from the tavern the other night.I beheld in the forest a beautiful sight.Sitting upon a fallen log he was;I could hardly believe me luck!.Of all good things to stumble upon.There in the wood, a wee Leprechaun!.Quiet as a mouse I crept up close.Still he sat, rubbing his toes.His long white beard flowed to the ground.Up I crept with nary a sound.Intent I was to grab and hold fast.This lucky Leprechaun so finally at last.I would have me three wishes and be myself told.The secret hiding place of his pot o' gold.A rich man, indeed; Rich I would be.So long as he didn't get away from me.Up I jumped when I got within reach.The wee green man let out a screech.By the coattails I had him; I tell you I did!.But somehow by magic he slipped me grip!.Off he ran, quick as a whip;The little feller gave me the slip.So now here I be poor as ever I've been.And do never expect such a chance again.But now when I travel after the sun is gone.I be hearing the laughter of a Leprechaun.";
    var scottish = "FROG AND CROW.'Ghille Criosda mhic Dhughail cuir a nois do mhàg'.Christ's servant, son of Dugald, put up thy paw.'Tha eagal orm, tha eagal orm, tha eagal orm'.I fear.'Gheibh thu còta gorm a's léine. Gheibh thu còta gorm a's léine'.Thou shalt have a blue coat and a shirt.Then the frog put up his hand and the hoodie took him to a hillock and began to eat him, saying,'Biadh dona lom! 's bu dona riabh thu'.Bad bare meat and bad wert thou ever.'Caite bheil do ghealladh math a nis?' said the frog.Where is thy good promise now?.'Sann ag ol a bha sinn an latha sin. Sann ag ol a bha sinn an latha sin'.It is drinking we were on that day.'Toll ort a ruid ghrannda gur beag feola tha air do chramhan'.'Toll ort!' said the hoodie.A hole in thee, ugly thing! how little flesh is on thy bones.";
    var spaans = "En el cuarto de los niños.Papá, mamá y todos los hermanitos habían ido a ver la comedia; Anita y su padrino quedaron solos en casa.También nosotros tendremos nuestra comedia - dijo el padrino -. Manos a la obra.Pero no tenemos teatro - replicó la pequeña Anita -, ni nadie que haga de cómico. Mi vieja muñeca es demasiado fea, y no quiero que se arrugue el vestido de la nueva.Cómicos siempre hay, si nos contentamos con lo que tenemos - dijo el padrino -.Ante todo vamos a construir el teatro. Pondremos aquí un libro, allí otro, y un tercero atravesado. Ahora tres del otro lado; ya tenemos los bastidores.Aquella caja vieja podrá servirnos de fondo; pondremos la base hacia fuera. La escena representa una habitación, esto está claro. Dediquémonos ahora a los personajes. Veamos qué hay en la caja de los juguetes. Primero los personajes, después la obra; cuando tengamos los primeros, la otra vendrá por sí sola, y la cosa saldrá que ni pintada. Aquí hay una cabeza de pipa, y allí un guante sin pareja; podrán ser padree hija.";
    var deutsch = "IM WALD.Über dem Hohlweg ein dunkler Saum aus Brombeergestrüpp und Haselsträuchern. Unten ein Schnauben, ein klirrendes Geräusch wie von Kettengliedern. Ein dumpfer, wuchtiger Schlag auf eine Planke. Und wieder flirrende Stille. Oben im Gebüsch fassen spitze Finger eine Dornenranke. Schieben sie, biegen sie sorgsam zur Seite. Da späht ein Mausgesicht hervor; das ist Alban.Der Junge musterte Gespann und Fuhrwerk drunten im Sand. Die Zugtiere standen breitbeinig und schwer, mit tief gesenkten Häuptern. Wie Spielzeug die Ladung: Fässer, Kisten, braune Säcke. Am Kutschbock steckte eine Peitsche. Kein Fahrer zu sehen, doch der tauchte gewiß wieder auf. Das Gefährt stand da wie gerufen; Alban hatte es sich so sehr gewünscht. Wohin die Reise ging? Das war ihm egal.";
    var nederlands = "Nel : door Desirée Roggen, 13 jaar.Piet zit aan de rand van het meer, zijn armen om zijn benen geklemd. Wat hij drie jaar geleden heeft meegemaakt heeft hem nog steeds niet losgelaten. Dat zijn beste vriend Willem zoiets heeft kunnen doen. Hij wist dat Willem haar verafschuwde, maar dan nog is het iets vreselijk. Hij heeft nu een meisje ontdekt dat op haar lijkt. Meteen moest hij weer aan haar denken. Zou ze het toestaan als hij met haar verkering zou nemen? Hij wist niet wat hij moest doen. Hij sloot zijn ogen. Hij moest terug denken aan de tijd dat hij haar ontmoette en haar ook weer verloor. Het meisje zonder moeder, het meisje waar hij van hield, Nel.Nel liep het café binnen. Daar zat Piet ook. Hij zag het meisje naar binnen lopen. Ze was mooi. Ze had lange zwarte haren, een rond gezichtje en was niet erg groot. Wat hem aan haar opviel waren die grote bruine ogen. Ze leerden elkaar al sNel kennen. Nel de heks en Piet de onervaren tovenaar. 'Ik leer je, je kunsten beheersen.' had ze tegen hem gezegd. Erg veel magie had ze zelf niet, maar wist wel hoe ze Piet zijn krachten moest leren. Elke dag kwamen ze bij elkaar. In het begin voor de lessen later voor wel meer dingen. Piet praatte vaak met zijn beste vriend Willem over haar, maar hij zei niet dat hij met haar omging. Willem had een grote afschuw van Nel. ";

    var max;
    var aantalzinnen=0;


    function Initieergeordend()
    {

    ingave = document.getElementById('bron').value;
        
        woordenschat =document.getElementById('bron').value;
        woordenschat=woordenschat.split(".");
           
        tijd = document.getElementById('leesduur').value;
        max= woordenschat.length;
        document.getElementById('zinnenintekst').value=max+1;
        aantalzinnen = document.getElementById('duuroefening').value; //100
        if(timerboolean)
            {
            clearTimeout(teller);
            timerboolean = false;
            }
        if (aantalzinnen==0)
            {
            StopTheClock();
            alert("Einde van de oefening.");
            }
        else
            {
            aantalzinnen = aantalzinnen - 1;
            timerboolean = true;

            document.getElementById('displaycell').innerHTML=woordenschat[x];
            t = woordenschat[x].length;
            x=x+1;
            tijd=tijd*t
            document.getElementById('berekendeleestijd').value=tijd;
            document.getElementById('duuroefening').value=aantalzinnen;
            teller = self.setTimeout("Initieergeordend()", tijd);
        }
    }


    function Initieerwillekeurig()
    {

    ingave = document.getElementById('bron').value;
     

        
        woordenschat =document.getElementById('bron').value;
        woordenschat=woordenschat.split(".");
        tijd = document.getElementById('leesduur').value;
        max= woordenschat.length;
        document.getElementById('zinnenintekst').value=max+1;
        aantalzinnen = document.getElementById('duuroefening').value; //100
        
        if(timerboolean)
            {
            clearTimeout(teller);
            timerboolean = false;
            }
        if (aantalzinnen==0)
            {
            StopTheClock();
            alert("Einde van de oefening.");
            }
        else
            {
            aantalzinnen = aantalzinnen - 1;
            timerboolean = true;
            randomnr = Math.random();
            document.getElementById('displaycell').innerHTML=woordenschat[Math.ceil(randomnr*max)-1];    
            t = woordenschat[Math.ceil(randomnr*max)-1].length;
            tijd=tijd*t;
            document.getElementById('berekendeleestijd').value=tijd;
            document.getElementById('duuroefening').value=aantalzinnen;

            teller = self.setTimeout("Initieerwillekeurig()", tijd);
        }
    }


    function StopTheClock()
    {
        if(timerboolean)
        {
               clearTimeout(teller);
            timerboolean = false;
        }
        location.reload(true);
    //alert("Einde van de oefening.")
    }

    function LaadIrish()
    {
    document.getElementById('bron').value=irish;
    }

    function LaadScottish()
    {
    document.getElementById('bron').value=scottish;
    }

    function LaadDeutsch()
    {
    document.getElementById('bron').value=deutsch;
    }

    function LaadNederlands()
    {
    document.getElementById('bron').value=nederlands;
    }

    function LaadSpaans()
    {
    document.getElementById('bron').value=spaans;
    }

    function laadinstructies()
    {
    document.getElementById('bron').value="Plak hier uw tekst of gebruik één van onderstaande knoppen die een voorbeeldtekst laden.rNieuwe tekst laden:rdruk Stop | druk Reset | plak nieuwe tekst | Start geordend/willekeurig";
    }
        
    </script>       

    </head>

    <body onload=laadinstructies()>

    <table border="0" width="100%">
        <tr>
            <td bgcolor="#3C0000" style="border: 1px solid #000000; ">
    <b>
    <font face="Arial" color="#FFFFFF">Oefen- en Hulpgereedschap : Leren lezen in
    een vreemde taal. Leer uw woordenschat : Leer gezegden en uitdrukkingen.</font></b></td>
        </tr>
        <tr>
            <td id="displaycell" class="display" height="151" style="border: 1px solid #C0C0C0">
            </td>
        </tr>
        <tr>
            <td></td>
        </tr>
    </table>
    <table border="0" width="100%" style="border: 1px solid #6C3600" bgcolor="#FF8C1A">
        <tr>
            <td width="81" valign="bottom">
            <input type="button" value="Start geordend" name="B4" onclick=Initieergeordend()></td>
            <td width="81" valign="bottom">
            <input type="button" value="Start willekeurig" name="B7" onclick=Initieerwillekeurig()></td>
            <td width="56" valign="bottom">
            <input type="button" value="Stop" name="B5" onclick=(StopTheClock())></td>
            <td width="166" valign="bottom">
            <font face="Arial" size="1"><b>Aantal keer oefenen</b> </font>
            <input id="duuroefening" value="10" size="6" name="duuroefening"></td>
            <td width="117" valign="bottom">
            <p align="left"><b><font face="Arial" size="1">Leestijd </font>
            </b>
            <input id="leesduur" value="70" size="6" name="leesduur"></td>
            <td valign="bottom" width="132"><font size="1" face="Arial">Aantal
            zinnen in de tekst</font></td>
            <td valign="bottom" width="63">
            <input id="zinnenintekst" value="0" size="6" name="randomkeuze" style="border: 1px solid #800000"></td>
            <td valign="bottom" width="144">
            <p align="right"><font size="1" face="Arial">Berekende  leestijd :</font></td>
            <td valign="bottom">
             <!--webbot bot="Validation" s-data-type="Number" s-number-separators="x," --><input id="berekendeleestijd" size="6" name="randomkeuze0" style="border: 1px solid #800000"></td>
        </tr>
    </table>
    <form id = "ingaveform" method="POST">
    <TABLE height="255" width="100%" cellspacing="0" >
            <TR>
                <TD HEIGHT=19 ALIGN=LEFT bgcolor="#3C0000"><b>
                <font face="Arial" size="2" color="#FFFFFF">Ingaveveld</font></b></TD>
            </TR>
            <TR>
                <TD HEIGHT=230 ALIGN=LEFT>
                   
                    <p align="center"><font face="Arial">
                    <textarea rows="10" name="S1" cols="114" id="bron" style="border: 1px solid #510000; ">
                    </textarea></font></p>
                    
                </TD>
            </TR>
            </TABLE>
            
    <TABLE height="18" width="100%" cellspacing="0" >
            <TR>
                <TD HEIGHT=18 ALIGN=LEFT bgcolor="#3C0000" width="204">
                <p align="center">
                    <font face="Arial">
                    <input type="reset" value="reset" name="B2" style="float: left"></font></TD>
                <TD HEIGHT=18 ALIGN=LEFT bgcolor="#3C0000" width="57">
                    <font face="Arial">
                    <input type="button" value="Irish" name="B6" onclick=LaadIrish()></font></TD>
                <TD HEIGHT=18 ALIGN=LEFT bgcolor="#3C0000" width="88">
                    <font face="Arial">
                    <input type="button" value="Scottish" name="B8" onclick=LaadScottish()></font></TD>
                <TD HEIGHT=18 ALIGN=LEFT bgcolor="#3C0000" width="80">
                    <font face="Arial">
                    <input type="button" value="Deutsch" name="B9" onclick=LaadDeutsch()></font></TD>
                <TD HEIGHT=18 ALIGN=LEFT bgcolor="#3C0000" width="91">
                    <font face="Arial">
                    <input type="button" value="Español" name="B10" onclick=LaadSpaans()></font></TD>
                <TD HEIGHT=18 ALIGN=LEFT bgcolor="#3C0000">
                    <font face="Arial">
                    <input type="button" value="Nederlands" name="B11" onclick=LaadNederlands()></font></TD>
            </TR>
    </TABLE>
    </form>

    </body>

    </html>

    18-02-2009 om 00:00 geschreven door de makers


    » Reageer (0)
    15-11-2008
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.Javascript :: tekst sorteren op unieke woorden :: sort text
    Code om een tekst uiteen te rafelen in afzonderlijke woorden de dubbels eruit te halen en de woorden te sorteren.

    In de huidige code worden enkel de volgende tekens weggeflterd. Indien je ook andere tekens wil elimineren moet fe deze code aanpassen :
    var chars =  new Array(''','<','>','-','(',')','{','}','"','.','?','¿','¡','!',':',';',',');


    De volledige code kan je copieëren in de hier onderstaande tabel.Wil je een werkend voorbeeld thuis op je pc copieer dan de code,plak deze  in je kladblok en je bewaart het bestand als een HTML - bestand.

    Test de code :: druk hier


    Javascript that separates all the words in a text , deletes the duplicates and sorts the remaining words.

    In the current code, only the following characters are filtered. If you want to filter other characters out of the result, you must adapt the following code :
    var chars = new Array (''','<','>','-','(',')','{','}','"','.','?', '¿','¡','!',':',';',',');

    You can copy the full code in the table below..

    Test the code here: Click here


    Javascript que separa todas las palabras en un texto, elimina los duplicados y ordenar todas las palabras.

    En el código actual, sólo los siguientes caracteres son filtrados. Si no desea otros caracteres en el resultado
    , usted debe adaptar el siguiente código:
    var caracteres = new Array (''','<','>','-','(',')','{','}','"','.','?', '¿','¡','!',':',';',',');

    Puede copiar el código completo en el cuadro que figura a continuación ..


    Probar el código aquí:   Click aqui

     

     

    15-11-2008 om 18:59 geschreven door de makers


    » Reageer (0)
    13-11-2008
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.Code sorteer tekst : sort text :: javascript

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">

    <HTML>
    <HEAD>
       
        <META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=windows-1252">
        <TITLE></TITLE>
        <META NAME="GENERATOR" CONTENT="OpenOffice.org 3.0  (Win32)">
        <META NAME="AUTHOR" CONTENT="piet willems">
        <META NAME="CREATED" CONTENT="20081112;20170300">
        <META NAME="CHANGED" CONTENT="0;0">
    <style>

    .schrijfstijl{border: 1px solid #4D636F; font-family:Tahoma; font-size:10pt}
    .mini{font-family:Tahoma; font-size:7pt;text-spacing:-1px;line-height:90%}
    </style>


        <script language=javascript>


        function splitsource(){
       
            var temp,temptemp;
            var defstring;
            var tempsplit = new Array(); // final array
            var split = new Array();
           
           
            temp = document.sourceform.source.value;
            temp = temp.toLowerCase();
            temp=temp.split("n");


            for(var i=0;i<temp.length;i++){
                temp[i] = removechars(temp[i]);
                 temptemp = temp[i].split(" ");
                 // second split on every space in the frase.
                tempsplit = tempsplit.concat(temptemp);
                // add the second split to the final array.
            }
           
            tempsplit.sort();
            tempsplit = RemoveDuplicates(tempsplit);
            //make tempsplit array displayable:

            for(i=0;i<tempsplit.length;i++){
                split = split+tempsplit[i]+"<br>";   
            }
            document.getElementById('result').className = 'schrijfstijl';
            document.getElementById('result').innerHTML = split; //
        }
       
        function removechars(string){
            var chars = new Array(',','r','n',''','<','>','-','(',')','{','}','"','.','?','¿','¡','!',':',';',',');
            // add (or change) here char's to the array if other char's need to be
            // removed.
            for(var c=0;c<chars.length;c++){
                string = string.replace(chars[c]," ");
            }
            return string;
        }
       
        function RemoveDuplicates(arr){

            var result=new Array(); // remove the doubles
            var lastValue="";

            for (var i=0; i<arr.length; i++)
                {
                  var curValue=arr[i];
                  if (curValue != lastValue)
                      {
                    result[result.length] = curValue;
                      }
                  lastValue=curValue;
                }
            return result;
            // return this result to the array : tempsplit.
           }
       
        </script>
       
    </HEAD>

    <BODY TEXT="#000000">
    <TABLE >
            <TR>
                <TD WIDTH=522 HEIGHT=18 ALIGN=LEFT bgcolor="#990000"><u><b>
                <font face="Arial" size="2" color="#FFFFFF">Javascript </font></b></u></TD>
            </TR>
            <TR>
                <TD WIDTH=522 HEIGHT=334 ALIGN=LEFT>
                <dl>
                    <dt><font face="Arial" size="2">Deze code leest het ingaveveld =
                brontekst , sorteert de brontekst en verwijderd de
                dubplicaatwoorden.</font></dt>
                    <dt><font face="Arial" size="2">vb: </font></dt>
                    <dt><font face="Arial" size="2">Copier de volgende tekst en plak hem
                onderin het iingaveveld.</font></dt>
                    <dt><font face="Arial" size="2">Druk nadien de "Verwerk" -knop.</font></dt>
                </dl>
                <table border="0" cellpadding="5" cellspacing="0" width="400">
                    <tr>
                        <td align="left" valign="top" bgcolor="#CED8C5" style="border: 1px solid #4F6949">
                        <textarea rows="8" name="S1" cols="61" id="source" style="border: 1px solid #687D55">Je kan niet voorstellen
    hoe de mensen de laatste tijd worden belogen
    hoe ze worden bedrogen
    hoe ze worden veracht en vernederd,
    alleen nog in wat ze opbrengen
    is er nog belangstelling.</textarea> </td>
                    </tr>
                </table>
                </TD>
            </TR>
            <TR>
                <TD HEIGHT=18 ALIGN=LEFT bgcolor="#990000"><b>
                <font face="Arial" size="2" color="#FFFFFF">Ingaveveld</font></b></TD>
            </TR>
            <TR>
                <TD HEIGHT=154 ALIGN=LEFT>
                <form method="POST" name="sourceform" action="">
                    <p><textarea rows="4" name="S1" cols="62" id="source"></textarea></p>
                    <input type="button" value="Verwerk" name="B1" onclick="splitsource()">
                    <input type="reset" value="reset" name="B2">
                </form>
                <p> </TD>
            </TR>
            <TR>
                <TD HEIGHT=18 ALIGN=LEFT bgcolor="#990000"><b>
                <font face="Arial" size="2" color="#FFFFFF">Resultaat</font></b></TD>
            </TR>
            <TR>
                <TD HEIGHT=40 ALIGN=LEFT id="result"> </TD>
            </TR>
            <TR>
                <TD HEIGHT=21 ALIGN=LEFT> </TD>
            </TR>
    </TABLE>

    </BODY>

    </HTML>

    13-11-2008 om 00:00 geschreven door de makers


    » Reageer (0)
    28-08-2008
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.onze tuin
    Onze Tuin


























    28-08-2008 om 00:13 geschreven door de makers


    » Reageer (0)
    29-07-2008
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.Aston Ariel op bezoek
    Aston Ariel op bezoek










    29-07-2008 om 00:00 geschreven door de makers


    » Reageer (0)
    20-07-2008
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.Hulpprogramma's :: Lezen | RSS - Nieuws

    Hulpprogramma's

    Geconcentreerd lezen : Leesrol : KLIK HIER
    RSS snelnieuws : KLIK HIER

    20-07-2008 om 00:00 geschreven door de makers


    » Reageer (0)
    06-06-2008
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.Presentationmodel :: buffered model :: RiverLayout
    Klik op de afbeelding om de link te volgen







    CustomerBean.java
    Structure

    package samples.s01
       
    CustomerBean.java
       
    PresentationModelBuild.java
       
    CustomerPresentationModel.java
       
    CustomBeanlaunch.java



    ----------------------------------------------------------------
    CustomerBean.java
    -----------------------------------------------------------------

    package samples.s01;

    *
     * Copyright (c) 2008 willems piet pwProTech  All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     *   - Redistributions of source code must retain the above copyright
     *     notice, this list of conditions and the following disclaimer.
     *
     *   - Redistributions in binary form must reproduce the above copyright
     *     notice, this list of conditions and the following disclaimer in the
     *     documentation and/or other materials provided with the distribution.
     *
     */

    import com.jgoodies.binding.beans.Model;

    public class CustomerBean extends Model {
        public static final String NAME_PROPERTY = "name";
        public static final String OCCUPATION_PROPERTY = "occupation";
        private String name;
        private String occupation;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            String oldValue = name;
            this.name = name;
            firePropertyChange(NAME_PROPERTY, oldValue, name);
        }

        public String getOccupation() {
            return occupation;
        }

        public void setOccupation(String occupation) {
            String oldValue = occupation;
            this.occupation = occupation;
            firePropertyChange(OCCUPATION_PROPERTY, oldValue, occupation);
        }

    }


    PresentationModelBuild.java


    package samples.s01;

    *
     * Copyright (c) 2008 willems piet pwProTech  All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     *   - Redistributions of source code must retain the above copyright
     *     notice, this list of conditions and the following disclaimer.
     *
     *   - Redistributions in binary form must reproduce the above copyright
     *     notice, this list of conditions and the following disclaimer in the
     *     documentation and/or other materials provided with the distribution.
     *
     */

    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.TextField;

    import javax.swing.JButton;
    import javax.swing.JCheckBox;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JTextField;

    import se.datadosen.component.RiverLayout;

    import com.jgoodies.binding.adapter.BasicComponentFactory;

    public class PresentationModelBuild extends JPanel {

        static JTextField nameInput,occupationInput;
        static JButton commitButton;
        static JButton resetButton;
        JButton sendButton;
        static CustomerPresentationModel presentationModel;

        public void createComponents() {

            presentationModel = new CustomerPresentationModel(
                    new CustomerBean());

            nameInput = BasicComponentFactory.createTextField(presentationModel
                    .getBufferedModel(CustomerBean.NAME_PROPERTY));
            occupationInput = BasicComponentFactory
                    .createTextField(presentationModel
                            .getBufferedModel(CustomerBean.OCCUPATION_PROPERTY));

            commitButton = new JButton(presentationModel.getCommitAction());
            resetButton = new JButton(presentationModel.getResetAction());
            sendButton = new JButton(presentationModel.getSendAction());
        }

        public void constructGui() {
            JFrame frame = new JFrame();
            JPanel CustomBeanFrm = new JPanel();
            frame.getContentPane().setLayout(new RiverLayout());
            frame.getContentPane().add(CustomBeanFrm);

            CustomBeanFrmGui(CustomBeanFrm);
            commitButton.setEnabled(false);
            commitButton.setEnabled(false);
            frame.pack();
            frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
            frame.setVisible(true);
        }

        private void CustomBeanFrmGui(JPanel CustomBeanFrm) {
            createComponents();
            CustomBeanFrm.setLayout(new RiverLayout());
            CustomBeanFrm.add("br left", new JLabel("PresentationModel"));
            CustomBeanFrm.add("br hfill", separator(Color.RED));


            CustomBeanFrm.add("br", new JLabel("Name"));
            CustomBeanFrm.add("tab hfill", nameInput);

            CustomBeanFrm.add("br", new JLabel("Occupation"));
            CustomBeanFrm.add("tab hfill", occupationInput);
            CustomBeanFrm.add("br hfill", separator(Color.GRAY));

           
            CustomBeanFrm.add("p br left", resetButton); // The button ins't really located to the left side
            CustomBeanFrm.add("center", sendButton);
            CustomBeanFrm.add("right", commitButton);
            CustomBeanFrm.add("br hfill", separator(Color.GRAY));

        }

        public static void clearForm() {
            commitButton.setEnabled(false);
            nameInput.setText("");
            occupationInput.setText("");

        }

        private static TextField separator(Color c) {
            TextField separator = new TextField();
            separator.setBackground(c);
            separator.setPreferredSize(new Dimension(20, 2));
            return separator;
        }
    }


    CustomerPresentationModel.java


    package samples.s01;

    *
     * Copyright (c) 2008 willems piet pwProTech  All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     *   - Redistributions of source code must retain the above copyright
     *     notice, this list of conditions and the following disclaimer.
     *
     *   - Redistributions in binary form must reproduce the above copyright
     *     notice, this list of conditions and the following disclaimer in the
     *     documentation and/or other materials provided with the distribution.
     *
     */

    import java.awt.event.ActionEvent;
    import javax.swing.AbstractAction;
    import javax.swing.Action;
    import com.jgoodies.binding.PresentationModel;

    public class CustomerPresentationModel extends PresentationModel {

        private static final long serialVersionUID = 1L;
        CommitAction commitAction;
        ResetAction resetAction;
        SendAction sendAction;
        ClearAction clearAction;
        private final CustomerBean customerBean;

        @SuppressWarnings("unchecked")
        public CustomerPresentationModel(CustomerBean customerBean) {
            super(customerBean);
            this.customerBean = customerBean;
            commitAction = new CommitAction();
            resetAction = new ResetAction();
            sendAction = new SendAction();
            clearAction = new ClearAction();

        }

        public Action getCommitAction() {
            return commitAction;
        }

        public Action getSendAction() {
            return sendAction;
        }

        public Action getResetAction() {
            return resetAction;
        }

        public Action getClearAction() {
            return clearAction;
        }
       
        private class CommitAction extends AbstractAction {
            /**
             *
             */
            private static final long serialVersionUID = 1L;

            public CommitAction() {
                super("Commit");
            }

            public void actionPerformed(ActionEvent e) {

                triggerCommit();
                //getBean();
                displayBufferAndBean("COMMIT action:");
                PresentationModelBuild.clearForm();// disable commitbutton

            }
        }

        private class SendAction extends AbstractAction {

            public SendAction() {
                super("Send");
            }

            public void actionPerformed(final ActionEvent e) {

                // getBean();
                if (PresentationModelBuild.resetButton.isEnabled()) {
                    PresentationModelBuild.resetButton.setEnabled(true);
                }

                if (isBuffering()) {
                    PresentationModelBuild.commitButton.setEnabled(true);

                    displayBufferAndBean("SEND Bufferd :true :: Not yet committed");
                } else {
                    PresentationModelBuild.commitButton.setEnabled(false);
                    displayBufferAndBean("SEND Bufferd :true :: yet Committed");
                    //Bufferd still true so by a reset the bufferd values are still available
                }

            }

        }

        private class ResetAction extends AbstractAction {

            public ResetAction() {
                super("Reset");
            }

            public void actionPerformed(ActionEvent e) {

                // release():
                // Removes the PropertyChangeHandler from the observed bean, if the
                // bean is not null. Also removes all listeners from the bean that
                // have been registered with #addBeanPropertyChangeListener before.
                if (isBuffering()) {
                    triggerFlush();
                    resetChanged();
                    System.out.println("RESET action : If changes : Previous restored");
                    PresentationModelBuild.commitButton.setEnabled(false);
                }
            }
        }

        private class ClearAction extends AbstractAction {
            // Not Used

            public ClearAction() {
                super("Clear Form");
            }

            public void actionPerformed(ActionEvent e) {

                PresentationModelBuild.resetButton.setEnabled(false);
                PresentationModelBuild.clearForm();
                System.out.println("clearform");
            }
        }

        private void displayBufferAndBean(String buffering) {
            System.out.println("" + "Result " + buffering + "n"
                    + "-------------------------------------------------n"
                    + "Bufferd values :" + "n"
                    + "Buffered beanvalue name :" + getBufferedValue("name") + "n"
                    + "Buffered beanvalue occupation :"+ getBufferedValue("occupation") + "n"
                    + "" + "n"
                    + "Bean values :" + "n"
                    + "CustomerBean value name :" + customerBean.getName() + "n"
                    + "CustomerBean value occupation :" + customerBean.getOccupation() + "n"
                    + "---------------------------------------------------");
        }
    }



    CustomBeanlaunch.java
    --------------------------------------------------------------------------------------------

    package samples.s01;

    *
     * Copyright (c) 2008 willems piet pwProTech  All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     *   - Redistributions of source code must retain the above copyright
     *     notice, this list of conditions and the following disclaimer.
     *
     *   - Redistributions in binary form must reproduce the above copyright
     *     notice, this list of conditions and the following disclaimer in the
     *     documentation and/or other materials provided with the distribution.
     *
     */

    public class CustomBeanlaunch {

        /**
         * @param args
         */
        public static void main(String[] args) {
            // TODO Auto-generated method stub
            PresentationModelBuild pme = new PresentationModelBuild();
            pme.constructGui();
        }
    }


    RESULTAAT



    Result SEND Bufferd :true :: Not yet committed
    -------------------------------------------------
    Bufferd values :
    Buffered beanvalue name :piet
    Buffered beanvalue occupation :job

    Bean values :
    CustomerBean value name :null
    CustomerBean value occupation :null
    ---------------------------------------------------
    RESET action : If changes : Previous restored
    Result SEND Bufferd :true :: Not yet committed
    -------------------------------------------------
    Bufferd values :
    Buffered beanvalue name :piet
    Buffered beanvalue occupation :job

    Bean values :
    CustomerBean value name :null
    CustomerBean value occupation :null
    ---------------------------------------------------
    Result COMMIT action:
    -------------------------------------------------
    Bufferd values :
    Buffered beanvalue name :piet
    Buffered beanvalue occupation :job

    Bean values :
    CustomerBean value name :piet
    CustomerBean value occupation :job
    ---------------------------------------------------

    Tags :: RiverLayout , JGoodies , Valueholder , bindings, formmodel , model , sample, samples, java

    06-06-2008 om 22:57 geschreven door de makers


    » Reageer (0)
    01-06-2008
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.Make a separator for RiverLayout:
    Klik op de afbeelding om de link te volgen








    Make a separator for RiverLayout:

    JFrame frame = new JFrame();
    frame.getContentPane().setLayout(new RiverLayout());
    frame.getContentPane().add("br left",new JLabel("PresentationModel"));
    frame.getContentPane().add("br hfill",separator(Color.RED));
    frame.getContentPane().add("br",comboboxPM);
    frame.getContentPane().add("tab hfill",fieldPM);
    frame.getContentPane().add("br hfill",separator(Color.GRAY));
    frame.getContentPane().add("br left",okButton);
    frame.getContentPane().add("right",revertButton);//DO NOT USE "TAB RIGHT"
    frame.getContentPane().add("br hfill",separator(Color.GRAY));

    ...

     

    private static TextField separator(Color c) {
        TextField separator = new TextField();
        separator.setBackground(c);
        separator.setPreferredSize(new Dimension(20,2));
    return separator;
    }

    01-06-2008 om 00:00 geschreven door de makers


    » Reageer (0)
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.Customize combobox (binding JGoodies):: Riverlayout
    Klik op de afbeelding om de link te volgen




    Customized comboboxes :: Riverlayout : JGoodies binding , valueholder



    package samples;

    /*
     * Copyright (c) 2008 - 2008 willems piet pwProTech  All rights reserved.
     *
     * Redistribution and use in source and binary forms, with or without
     * modification, are permitted provided that the following conditions
     * are met:
     *
     *   - Redistributions of source code must retain the above copyright
     *     notice, this list of conditions and the following disclaimer.
     *
     *   - Redistributions in binary form must reproduce the above copyright
     *     notice, this list of conditions and the following disclaimer in the
     *     documentation and/or other materials provided with the distribution.
     *
     *
     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
     * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
     * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
     * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
     * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
     * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     */

    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.util.ArrayList;

    import javax.swing.JButton;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.border.EmptyBorder;

    import se.datadosen.component.RiverLayout;

    import com.jgoodies.binding.adapter.BasicComponentFactory;
    import com.jgoodies.binding.adapter.ComboBoxAdapter;
    import com.jgoodies.binding.value.ValueHolder;
    import com.jgoodies.binding.value.ValueModel;

    public class CustomComboAdapter extends JPanel {
        private String CMD_OK = "cmd.ok"/* NOI18N */;

        private JButton okButton;

        public ComboValueHolder ch, cl; // static

        public CustomComboAdapter() {
            JPanel panel = new JPanel(new RiverLayout());
            panel.setBorder(new EmptyBorder(6, 6, 6, 6));
            riverFormBuilder(panel);
            add(panel);
        }

        private void riverFormBuilder(JPanel panel) {
            ArrayList<String> countries = new ArrayList<String>();
            countries.add("England");
            countries.add("Scotland");
            countries.add("Iereland");
            countries.add("Nedtherlands");
            countries.add("Flanders");

            ArrayList<String> languages = new ArrayList<String>();
            languages.add("Dutch");
            languages.add("English");
            languages.add("Spanish");
            languages.add("German");
            languages.add("Russian");
           
            Dimension d = new Dimension(150, 20);
            Font userfont = new Font("Arial",1,12);
           
            ch = new ComboValueHolder();
            ch.setStartselection("Make selection");
            JComboBox countriesComboBoxes = ch.customComboBox(countries, d,userfont,Color.WHITE);

            cl = new ComboValueHolder();
            cl.setStartselection("Spanish");
            JComboBox combolanguageBox = cl.customComboBox(languages, d,userfont,Color.WHITE);
           
            okButton = new JButton();
            okButton.setText("ok");
            okButton.setActionCommand(CMD_OK);
            okButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent event) {
                    // windowAction(event);
                    System.out.println("Combo selection country"
                            + ch.getSelectionHolder().getValue());
                    System.out.println("Combo selection language"
                            + cl.getSelectionHolder().getValue());
                    System.out.println(okButton.getActionCommand());

                }
            });

            panel.add("p", new JLabel("ComboBox Countries:"));
            panel.add("tab hfill", countriesComboBoxes);
            panel.add("tab tab", new JLabel("Selection:"));
            panel.add("tab tab tab hfill", BasicComponentFactory.createTextField(ch
                    .getSelectionHolder()));

            panel.add("p", new JLabel("ComboBox Languages:"));
            panel.add("tab hfill", combolanguageBox);
            panel.add("tab tab", new JLabel("Selection:"));
            panel.add("tab tab tab hfill", BasicComponentFactory.createTextField(cl
                    .getSelectionHolder()));
            panel.add("p hfill", okButton);
        }

        public static void main(String[] a) {
            JFrame f = new JFrame("Custom ComboBox");
            f.setDefaultCloseOperation(2);
            f.add(new CustomComboAdapter());
            f.pack();
            f.setVisible(true);
        }

        public class ComboValueHolder {
            String startselection;

            ValueModel selectionHolder;

            public ValueModel ComboHolder() {
                ValueModel selectionHolder = new ValueHolder(this.startselection);
                setSelectionHolder(selectionHolder);
                return selectionHolder;
            }

            public JComboBox customComboBox(ArrayList countries, Dimension d, Font font, Color color) {

                ComboBoxAdapter comboBoxAdapter = new ComboBoxAdapter(countries,ComboHolder());
                JComboBox comboBox = new JComboBox();
                comboBox.setPreferredSize(d);
                comboBox.setFont(font);
                comboBox.setBackground(color);
                comboBox.setModel(comboBoxAdapter);
                return comboBox;
            }

            public String getStartselection() {
                return startselection;
            }

            public void setStartselection(String startselection) {
                this.startselection = startselection;
            }

            public ValueModel getSelectionHolder() {
                return selectionHolder;
            }

            public void setSelectionHolder(ValueModel selectionHolder) {
                this.selectionHolder = selectionHolder;
            }

        }
    }


    Tags :: RiverLayout , JGoodies , Valueholder , bindings, formmodel , model , sample, samples, java

    01-06-2008 om 00:00 geschreven door de makers


    » Reageer (0)
    29-05-2008
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.Test Riverlayout :: sample


     
    Project Test Riverlayout :: working example jgoodies binding remove and load jpanels

    Test RiverLayout :: (pics dir: see bottom)

    Package beans
    1.SingleForm.java
    2.TripleForm.java

    Package forms.masterforms
    1.SingleMasterForm.java
    2.TripleMasterForm.java

    Package se.datadosen
    > Download riverlayout.zip


    Package src
    1.MenuBar.java
    2.OpeningForm.java


    Package testen
    1.RiverLayoutTest.java

     
    CODE:
    SingleForm.java
    package beans;
    /*
    * Copyright (c) 2008 - 2008 willems piet pwProTech All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * - Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * - Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
    * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    */
    import com.jgoodies.binding.beans.Model;
    //This configuration is more advanced then the tripleform bean and uses JGoodies beans.model
    public class SingleForm extends Model {
    String name, street, nr, towncity, occupation;
    	public String getName() {
    return name;
    }
    	public void setName(String name) {
    this.name = name;
    }
    	public String getNr() {
    return nr;
    }
    	public void setNr(String nr) {
    this.nr = nr;
    }
    	public String getOccupation() {
    return occupation;
    }
    	public void setOccupation(String occupation) {
    this.occupation = occupation;
    }
    	public String getStreet() {
    return street;
    }
    	public void setStreet(String street) {
    this.street = street;
    }
    	public String getTowncity() {
    return towncity;
    }
    	public void setTowncity(String towncity) {
    this.towncity = towncity;
    }
    }
    
    TripleForm.java
    package beans;
    /*
    * Copyright (c) 2008 - 2008 willems piet pwProTech All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * - Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * - Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
    * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    */
    import java.beans.PropertyChangeListener;
    import com.jgoodies.binding.beans.ExtendedPropertyChangeSupport;
    public class TripleForm {
    	//ToDo :: see singlemasterform : extends Model
    	String username, age, comment;
    	boolean menuItemEnabled;
    	private ExtendedPropertyChangeSupport changeSupport = new ExtendedPropertyChangeSupport(
    this);
    	public String getUsername() {
    return username;
    }
    	public void setUsername(String username) {
    String oldValue = username;
    this.username = username;
    changeSupport.firePropertyChange("stringValue", oldValue, username);
    System.out.println(username);
    }
    	public String getAge() {
    return age;
    }
    	public void setAge(String age) {
    String oldValue = age;
    this.age = age;
    changeSupport.firePropertyChange("stringValue", oldValue, age);
    System.out.println(age);
    }
    	public String getComment() {
    return comment;
    }
    	public void setComment(String comment) {
    String oldValue = comment;
    this.comment = comment;
    changeSupport.firePropertyChange("stringValue", oldValue, comment);
    System.out.println(comment);
    }
    	public void addPropertyChangeListener(PropertyChangeListener x) {
    changeSupport.addPropertyChangeListener(x);
    }
    	public void removePropertyChangeListener(PropertyChangeListener x) {
    changeSupport.removePropertyChangeListener(x);
    }
    	public boolean isMenuItemEnabled() {
    return menuItemEnabled;
    }
    	public void setMenuItemEnabled(boolean menuItemEnabled) {
    this.menuItemEnabled = menuItemEnabled;
    }
    }
     
    
    SingleMasterForm.java
    package forms.masterforms;
    /*
    * Copyright (c) 2008 - 2008 willems piet pwProTech All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * - Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * - Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
    * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    */
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JMenuItem;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    import se.datadosen.component.RiverLayout;
    import src.MenuBar;
    import beans.SingleForm;
    import com.jgoodies.binding.adapter.BasicComponentFactory;
    import com.jgoodies.binding.beans.BeanAdapter;
    import com.jgoodies.binding.value.ValueModel;
    import com.jgoodies.forms.factories.Borders;
    public class SingleMasterForm {
    	private String CMD_OK = "cmd.ok"/* NOI18N */;
    	private JButton okButton;
    	public JPanel buildform(final JFrame f, final JMenuItem menuitem) {
    okButton = new JButton();
    okButton.setText("ok");
    okButton.setActionCommand(CMD_OK);
    okButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent event) {
    // windowAction(event);
    System.out
    .println("ACTION : BUTTON OK WAS CLICKED and Menu item enabled");
    System.out.println(okButton.getActionCommand());
    menuitem.setEnabled(true);//and close
    MenuBar.FrameClearAction(f);
    }
    });
    		SingleForm bean = new SingleForm();
    BeanAdapter adapter = new BeanAdapter(bean, true);
    		ValueModel nameModel = adapter.getValueModel("name");
    ValueModel streetModel = adapter.getValueModel("street");
    ValueModel nrModel = adapter.getValueModel("nr");
    ValueModel towncityModel = adapter.getValueModel("towncity");
    ValueModel occupationModel = adapter.getValueModel("occupation");
    		JTextField nameinput = BasicComponentFactory.createTextField(nameModel);
    JTextField streetinput = BasicComponentFactory
    .createTextField(streetModel);
    JTextField nrinput = BasicComponentFactory.createTextField(nrModel);
    JTextField towncityinput = BasicComponentFactory
    .createTextField(towncityModel);
    JTextField occupationinput = BasicComponentFactory
    .createTextField(occupationModel);
    		// Panel
    		// SingleMasterForm
    JPanel SingleMasterForm = new JPanel();
    SingleMasterForm.setLayout(new RiverLayout());
    SingleMasterForm.add("right", new JLabel("Single Form demo"));
    SingleMasterForm.add("p left", new JLabel("Name"));
    SingleMasterForm.add("tab hfill", nameinput);
    SingleMasterForm.add("br", new JLabel("Street"));
    SingleMasterForm.add("tab hfill", streetinput);
    SingleMasterForm.add("br vtop", new JLabel("nr"));
    SingleMasterForm.add("tab", nrinput);
    nrinput.setColumns(5);
    SingleMasterForm.add("br vtop", new JLabel("Town/City"));
    SingleMasterForm.add("tab hfill", towncityinput);
    SingleMasterForm.add("br vtop", new JLabel("Occupation"));
    SingleMasterForm.add("tab hfill", occupationinput);
    SingleMasterForm.add("p right", okButton);
    SingleMasterForm.setBorder(Borders.DIALOG_BORDER);
    		return SingleMasterForm;
    }
    }
     
    
    TripleMasterForm.java
    
    package forms.masterforms;
    /*
    * Copyright (c) 2008 - 2008 willems piet pwProTech All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * - Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * - Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
    * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    */
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JMenuItem;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JSplitPane;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.border.EmptyBorder;
    import se.datadosen.component.RiverLayout;
    import src.MenuBar;
    import beans.TripleForm;
    import com.jgoodies.binding.adapter.BasicComponentFactory;
    import com.jgoodies.binding.beans.BeanAdapter;
    import com.jgoodies.binding.value.ValueModel;
    import com.jgoodies.forms.factories.Borders;
    public class TripleMasterForm extends TripleForm {
    	private String CMD_OK = "cmd.ok"/* NOI18N */;
    	private JButton okButton, ok1Button, ok2Button;
    	public JPanel formRegistration(final JFrame f, final JMenuItem menuitem) {
    okButton = new JButton();
    okButton.setText("ok");
    okButton.setActionCommand(CMD_OK);
    		okButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent event) {
    // windowAction(event);
    System.out
    .println("ACTION : BUTTON OK WAS CLICKED and menu item enabled");
    System.out.println(okButton.getActionCommand());
    menuitem.setEnabled(true);//and close
    MenuBar.FrameClearAction(f);
    }
    });
    		ok1Button = new JButton();
    ok1Button.setText("ok 1");
    ok1Button.setActionCommand(CMD_OK);
    ok1Button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent event) {
    // windowAction(event);
    System.out.println("ACTION : BUTTON 1 OK WAS CLICKED");
    System.out.println(ok1Button.getActionCommand());
    menuitem.setEnabled(true);//and close
    MenuBar.FrameClearAction(f);
    }
    });
    		ok2Button = new JButton(); // we'll need this soon
    ok2Button.setText("ok 2");
    ok2Button.setActionCommand(CMD_OK);
    ok2Button.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent event) {
    // windowAction(event);
    System.out.println("ACTION : BUTTON 2 OK WAS CLICKED");
    System.out.println(ok2Button.getActionCommand());
    menuitem.setEnabled(true);//and close
    MenuBar.FrameClearAction(f);
    }
    });
    		TripleForm bean = new TripleForm();
    BeanAdapter adapter = new BeanAdapter(bean, true);
    		ValueModel nameModel = adapter.getValueModel("username");
    ValueModel ageModel = adapter.getValueModel("age");
    ValueModel commentModel = adapter.getValueModel("comment");
    		JTextField userinput = BasicComponentFactory.createTextField(nameModel);
    JTextField ageinput = BasicComponentFactory.createTextField(ageModel);
    JTextArea commentinput = BasicComponentFactory
    .createTextArea(commentModel);
    		ValueModel nameModel01 = adapter.getValueModel("username");
    ValueModel ageModel01 = adapter.getValueModel("age");
    ValueModel commentModel01 = adapter.getValueModel("comment");
    		JTextField userinput01 = BasicComponentFactory
    .createTextField(nameModel01);
    JTextField ageinput01 = BasicComponentFactory
    .createTextField(ageModel01);
    JTextArea commentinput01 = BasicComponentFactory
    .createTextArea(commentModel01);
    		ValueModel nameModel02 = adapter.getValueModel("username");
    ValueModel ageModel02 = adapter.getValueModel("age");
    ValueModel commentModel02 = adapter.getValueModel("comment");
    		JTextField userinput02 = BasicComponentFactory
    .createTextField(nameModel02);
    JTextField ageinput02 = BasicComponentFactory
    .createTextField(ageModel02);
    JTextArea commentinput02 = BasicComponentFactory
    .createTextArea(commentModel02);
    		// Panel 1 = left + center
    		// left
    JPanel left = new JPanel();
    left.setLayout(new RiverLayout());
    left.add("right", new JLabel("Registration form left"));
    left.add("p left", new JLabel("Name"));
    left.add("tab hfill", userinput);
    left.add("br", new JLabel("Age"));
    ageinput.setColumns(5);
    left.add("tab", ageinput);
    left.add("br vtop", new JLabel("Comment"));
    commentinput.setRows(3);
    left.add("tab hfill vfill", new JScrollPane(commentinput));
    left.add("p right", okButton);
    // added to level the content of the 3 panels
    left.setBorder(Borders.DIALOG_BORDER);
    		// center
    JPanel center = new JPanel();
    center.setLayout(new RiverLayout());
    center.add("right", new JLabel("Registration form center"));
    center.add("p left", new JLabel("Name-center"));
    center.add("tab hfill", userinput01);
    center.add("br", new JLabel("Age-center"));
    ageinput01.setColumns(2);
    center.add("tab", ageinput01);
    center.add("br vtop", new JLabel("Comment-center"));
    center.add("tab hfill vfill", new JScrollPane(commentinput01));
    center.add("p right", ok1Button);
    center.add(left);
    // added to level the content of the 3 panels
    center.setBorder(Borders.DIALOG_BORDER);
    		JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
    left, center);
    JPanel panel1 = new JPanel();
    panel1.setLayout(new RiverLayout());
    splitPane.setBorder(new EmptyBorder(-10, -5, -20, -8));
    //splitPane.setDividerLocation(150);
    //splitPane.setOneTouchExpandable(true);
    splitPane.setDividerSize(3);
    panel1.add("hfill vfill", splitPane);
    		JPanel right = new JPanel();
    right.setLayout(new RiverLayout());
    right.add("right", new JLabel("Registration form right"));
    right.add("p left", new JLabel("Name-right"));
    right.add("tab hfill", userinput02);
    right.add("br", new JLabel("Age-right"));
    ageinput02.setColumns(3);
    right.add("tab", ageinput02);
    right.add("br vtop", new JLabel("Comment-right"));
    right.add("tab hfill vfill", new JScrollPane(commentinput02));
    right.add("p right", ok2Button);
    // added to level the content of the 3 panels
    right.setBorder(new EmptyBorder(6, 0, 6, 0));
    		JSplitPane splitPane0 = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
    panel1, right);
    		splitPane0.setBorder(new EmptyBorder(-4, 0, -10, 0));
    splitPane0.setDividerSize(3);
    		//RegistrationMasterForm
    		JPanel masterform = new JPanel();
    masterform.setLayout(new RiverLayout());
    masterform.add("vfill hfill", splitPane0);
    		return masterform;
    }
    }
     
    
    MenuBar.java
    package src;
    /*
    * Copyright (c) 2008 - 2008 willems piet pwProTech All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * - Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * - Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
    * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    */
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.KeyEvent;
    import javax.swing.ImageIcon;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    import javax.swing.KeyStroke;
    import se.datadosen.component.RiverLayout;
    import forms.masterforms.SingleMasterForm;
    import forms.masterforms.TripleMasterForm;
    public class MenuBar {
    protected JMenuBar menuBar;
    	public JMenuBar MenuBarRegistration(JFrame frame) {
    //send to where the GUI is created:
    //Call : frame.setJMenuBar( MenuBarRegistration(frame));
    		JMenu menu, submenu;
    JMenuItem menuItem1, menuItem2, menuItem3, menuItem4, menuItem5, menuItem51, menuItem52;
    		//Create the menu bar.
    menuBar = new JMenuBar();
    		//Build the first menu.
    menu = new JMenu("TestMenu 1");
    menu.setMnemonic(KeyEvent.VK_A);
    //menu.getAccessibleContext().setAccessibleDescription(
    // "The only menu in this program that has menu items");
    menuBar.add(menu);
    		//a group of JMenuItems
    menuItem1 = new JMenuItem("Clear test", KeyEvent.VK_T);
    menuItem1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_1,
    ActionEvent.ALT_MASK));
    menuItem1.setName("een");
    menu.add(menuItem1);
    		//  Text - icon sample
    menuItem2 = new JMenuItem("Single form", new ImageIcon(
    "images/yourpic.gif"));
    		menuItem2.setMnemonic(KeyEvent.VK_B);
    menuItem2.setName("singlemasterform");
    menu.add(menuItem2);
    		menuItem3 = new JMenuItem("Triple form", new ImageIcon(
    "images/yourpic.gif"));
    menuItem3.setMnemonic(KeyEvent.VK_B);
    menuItem3.setName("twee");
    menu.add(menuItem3);
    		menuItem5 = new JMenuItem(new ImageIcon("images/yourpic.gif"));
    //Only icon dample
    menuItem5.setMnemonic(KeyEvent.VK_D);
    menu.add(menuItem3);
    		//a submenu
    menu.addSeparator();
    submenu = new JMenu("Submenu sample");
    submenu.setMnemonic(KeyEvent.VK_S);
    		menuItem51 = new JMenuItem("Submenu item 1 sample");
    menuItem51.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_2,
    ActionEvent.ALT_MASK));
    submenu.add(menuItem51);
    		menuItem52 = new JMenuItem("Submenu item 2 sample");
    submenu.add(menuItem52);
    menu.add(submenu);
    		//Build second menu in the menu bar.
    menu = new JMenu("TestMenu 2");
    menu.setMnemonic(KeyEvent.VK_N);
    menuBar.add(menu);
    		//Adding action listener to menu items
    //------------------------------------
    menuAction(menuItem1, frame);
    menuAction(menuItem2, frame);
    menuAction(menuItem3, frame);
    		menuItem51.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    System.out.println("SubmenuItem 1 is pressed");
    }
    });
    menuItem52.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    System.out.println("SubmenuItem 2 is pressed");
    }
    });
    		return menuBar;
    	}
    	private void menuAction(final JMenuItem menuItem, final JFrame f) {
    menuItem.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    String action = menuItem.getName();
    System.out.println("action" + action);
    if (action.equals("een")) {
    menuSelectionClearContentPane(f);
    } else if (action.equals("twee")) {
    menuSelectionTripleMasterForm(menuItem, f);
    } else if (action.equals("singlemasterform")) {
    menuSelectionSingleMasterForm(menuItem, f);
    }
    }
    			private void menuSelectionClearContentPane(final JFrame f) {
    enableItemsMenu0();
    FrameClearAction(f);
    System.out.println(f.getName() + " is Cleared");
    }
    			private void menuSelectionSingleMasterForm(
    final JMenuItem menuItem, final JFrame f) {
    enableItemsMenu0();
    menuItem.setEnabled(false);
    f.getContentPane().removeAll();
    SingleMasterForm smf = new SingleMasterForm();
    f.setLayout(new RiverLayout());
    f.getContentPane().add("hfill vfill",
    smf.buildform(f, menuItem));
    System.out.println(f.getName() + " is installed");
    f.validate();
    f.repaint();
    }
    			private void menuSelectionTripleMasterForm(
    final JMenuItem menuItem, final JFrame f) {
    enableItemsMenu0();
    menuItem.setEnabled(false);
    f.getContentPane().removeAll();
    TripleMasterForm rmf = new TripleMasterForm();
    rmf.setMenuItemEnabled(false);
    f.setLayout(new RiverLayout());
    f.getContentPane().add("hfill vfill",
    rmf.formRegistration(f, menuItem));
    System.out.println(f.getName() + " is installed");
    f.validate();
    f.repaint();
    }
    			private void enableItemsMenu0() {
    //ToDo name the item indexes
    getMenuItem(0, 0).setEnabled(true);
    getMenuItem(0, 1).setEnabled(true);
    getMenuItem(0, 2).setEnabled(true);
    }
    });
    }
    	public static void FrameClearAction(JFrame f) {
    		f.getContentPane().removeAll();
    f.getContentPane().setLayout(new RiverLayout());
    f.getContentPane().add(new JLabel("Frame Cleared"));
    f.validate();
    f.repaint();
    		System.out.println("pass" + f.getContentPane().getComponents());
    }
    	protected JMenuItem getMenuItem(int menuIndex, int itemIndex) {
    //JMenuBar menuBar;
    JMenu menu = menuBar.getMenu(menuIndex);
    System.out.println(menu.getName());
    return menu.getItem(itemIndex);
    }
    }
     
    OpeningForm.java
    
    package src;
    /*
    * Copyright (c) 2008 - 2008 willems piet pwProTech All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * - Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * - Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
    * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    */
    import java.awt.Dimension;
    import java.awt.Font;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import se.datadosen.component.RiverLayout;
    public class OpeningForm {
    public static JPanel buildForm() {
    JPanel openingPanel = new JPanel();
    openingPanel.setLayout(new RiverLayout());

            JLabel infoLabel = new JLabel();
    JLabel gapLabel = new JLabel();
            gapLabel.setPreferredSize(new Dimension(150, 240));
    infoLabel.setPreferredSize(new Dimension(400, 240));
    infoLabel.setFont(new Font("sansserif", Font.BOLD, 32));
    infoLabel.setText("Test Riverlayout");
    openingPanel.add("p" , gapLabel);
    openingPanel.add("tab" , infoLabel);
    return openingPanel;
    }
    }
     
    
    RiverLayoutTest.java
    package testen;
    /*
    * Copyright (c) 2008 - 2008 willems piet pwProTech All rights reserved.
    *
    * Redistribution and use in source and binary forms, with or without
    * modification, are permitted provided that the following conditions
    * are met:
    *
    * - Redistributions of source code must retain the above copyright
    * notice, this list of conditions and the following disclaimer.
    *
    * - Redistributions in binary form must reproduce the above copyright
    * notice, this list of conditions and the following disclaimer in the
    * documentation and/or other materials provided with the distribution.
    *
    *
    * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
    * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    */
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import com.jgoodies.forms.factories.Borders;
    import beans.TripleForm;
    import se.datadosen.component.RiverLayout;
    import src.MenuBar;
    /* TopLevelDemo.java requires no other files. */
    public class RiverLayoutTest {
    /**
    * Create the GUI and show it.
    */
    private static void createAndShowGUI() {
    //Create and set up the window.
    JFrame frame = new JFrame("Test Layout");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().setLayout(new RiverLayout());
    		//Set the menu bar and add the openingForm to the content pane.
    frame.setJMenuBar(new MenuBar().MenuBarRegistration(frame));
    frame.getContentPane().add("hfill", src.OpeningForm.buildForm());
    		//Display the window.
    frame.setLocation(150, 200);
    frame.pack();
    frame.setVisible(true);
    }
    	public static void main(String[] args) {
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();
    }
    });
    }
    }

    Tags : RiverLayout , sample , java , example , jgoodies , valuemodel, model

     


    29-05-2008 om 00:00 geschreven door de makers


    » Reageer (0)
    20-05-2008
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.Project pw Helpdesk
    Klik op de afbeelding om de link te volgen



    Started with new project helpdesk:




    -basic layout : see pic

    -todo :  treeview final configuration
    -todo : create searchpanel
    -todo : create tabpane » reflecting search
    -todo : implement riverlayout as a test.

    20-05-2008 om 12:44 geschreven door de makers


    » Reageer (0)
    Klik hier om een link te hebben waarmee u dit artikel later terug kunt lezen.LookAndFeel
    Klik op de afbeelding om de link te volgen



    LookAndFeel




    To change the lookandfeel for example to "windowslookandfeel" you will have to add
    UIManager.setLookAndFeel to your code :: see sample

    buildregistration.java  [ full example code :  see 19-05-2008 ]

    package formbuilding;

    import javax.swing.JFrame;
    import javax.swing.UIManager;
    import javax.swing.UnsupportedLookAndFeelException;

    import formbeans.Registration;

    public class BuildRegistration {

        public BuildRegistration(String title) {
            JFrame f = new JFrame(title);
            try {
                UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
            } catch (ClassNotFoundException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (InstantiationException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IllegalAccessException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (UnsupportedLookAndFeelException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            Registration r = new Registration();
            f.setLocation(200, 200);
            r.formRiverLayout(f);
            f.pack();
            f.setVisible(true);

        }

        public static void main(String[] args) {
            BuildRegistration br = new BuildRegistration("Registration");

        }
    }

    20-05-2008 om 00:00 geschreven door de makers


    » Reageer (0)

    >

    Blog tegen de regels? Meld het ons!
    Gratis blog op http://blog.seniorennet.be - SeniorenNet Blogs, eenvoudig, gratis en snel jouw eigen blog!