:: codemode.org :: :: mmmmm....apelsin ::

3 comments 2004-08-10 Introducing the Reflexive User Interface Builder [www-106.ibm.com]
om man nu tycker det är kul att koda i xml.


2004-08-10 13:59 apl
nja..eller nåt. funkar nog bättre nu, men quickfixes kan ha märkliga sidoeffekter.


2004-08-10 13:27 andreas
Fattas nog en pretag där...


2004-08-10 13:27 andreas
Vaddå? Jag skriver mycket hellre

<?xml version="1.0"?>

<rib:gui
xmlns:rib="com.ibm.wac.rgb"
xmlns="swing"
rib:scriptlang="jython"
rib:architecture="swing"
>

<rib:scripts>
import javax.accessibility.AccessibleRelation as AccRelation
</rib:scripts>

<rib:aliases>
<rib:alias
rib:name="BorderLayout"
rib:value="java.awt.BorderLayout"
/>
<rib:alias
rib:name="acName"
rib:value="!getAccessibleContext!setAccessibleName"
/>
</rib:aliases>

<rib:objects>
<Dimension rib:id="screenDim">300, 150</Dimension>
<Color rib:id="bkgdColor">224, 224, 255</Color>
</rib:objects>

<rib:components>
<Frame rib:id="mainFrame"
size="@screenDim"
title="RGB -- Sample 1 fddlkjlkdlkdflkd"
background="@bkgdColor"
>

<getRootPane>
<defaultButton button="@clearButton"/>
</getRootPane>

<addWindowFocusListener><windowFocusGained>
nameField.requestFocus()
</windowFocusGained></addWindowFocusListener>

<getContentPane>
<Panel rib:id="infoPanel" rib:constraints="NORTH"
layout="%BorderLayout"
>
<Box rib:constraints="NORTH">
swing.BoxLayout.X_AXIS
<horizontalGlue/>
<Label rib:id="nameLabel"
text="Name:"
labelFor="@nameField"
horizontalAlignment="RIGHT"
/>
<horizontalStrut width="4"/>
<TextField rib:id="nameField"
columns="20"
toolTipText="Enter your full name"
focusAccelerator="n"
>
<acName name="name input field"/>
<acRelation rel="{AccRelation(AccRelation.LABELED_BY, nameLabel)}"/>
</TextField>
<horizontalStrut width="8"/>

<Label rib:id="emailLabel"
text="Email:"
labelFor="@emailField"
horizontalAlignment="RIGHT"
/>
<horizontalStrut width="4"/>
<TextField rib:id="emailField"
columns="20"
toolTipText="Enter your email address"
>
<acName name='email input field'/>
<acRelation rel="{AccRelation(AccRelation.LABELED_BY, emailLabel)}"/>
</TextField>
<horizontalGlue/>
</Box>

<Box rib:constraints="SOUTH">
swing.BoxLayout.X_AXIS
<horizontalGlue/>
<Button rib:id="clearButton" text="Clear"
toolTipText="Clear the form fields">
<mnemonic>
awt.event.KeyEvent.VK_R
</mnemonic>
<addActionListener>
nameField.text = ""
emailField.text = ""
</addActionListener>
</Button>

<horizontalStrut width="6"/>
<Button rib:id="exitButton" text="Exit"
toolTipText="Exit the app">
<mnemonic>
awt.event.KeyEvent.VK_X
</mnemonic>
<addActionListener>
confirm = \
swing.JOptionPane.showConfirmDialog(
mainFrame,
"Confirm Exit",
"Confirm Exit Dialog",
swing.JOptionPane.YES_NO_OPTION
)
if confirm == swing.JOptionPane.YES_OPTION:
lang.System.exit(0)
</addActionListener>
</Button>
<horizontalGlue/>
</Box>
</Panel>

</getContentPane>
</Frame>
</rib:components>
</rib:gui>

Än kodar JAVA! ( *_*)


name: remember me
comment:


enter the code:

21611 links, 2648 comments, 12947483 clicks.