Article ID: 201484
Article Last Modified on 11/14/2005
// Propertydialog.java
import java.awt.*;
import com.ms.ui.*;
import com.ms.ui.event.*;
import java.awt.event.*;
import com.ms.fx.*;
import java.text.*;
class propertydialog extends UIFrame implements IUIActionListener
{
public static void main(String args[])
{
try {
propertydialog app = new propertydialog();
app.resize(200, 100);
app.show();
}
catch (Exception e) {
e.printStackTrace();
}
}
public boolean handleEvent(Event e)
{
if (e.id == Event.WINDOW_DESTROY)
System.exit(0);
return (super.handleEvent(e));
}
public propertydialog()
{
setLayout(new UIFlowLayout());
UIPushButton pb = new
UIPushButton("Create PropertyDialog",UIPushButton.RAISED);
pb.addActionListener(this);
add(pb);
}
public void createDialog()
{
UIFrame frame = new UIFrame("Dialog");
UIPropertyDialog dialog = new myDialog(frame, false);
myPage sheet = new myPage(dialog);
dialog.addPage("PropertySheet1",sheet);
System.out.println("Displaying Property Sheet");
Object o = dialog.display();
System.out.println("Property sheet returned " + o);
}
public void actionPerformed(UIActionEvent event)
{
createDialog();
}
}
class myDialog extends UIPropertyDialog
{
public myDialog(UIFrame f, boolean modal) {
super(f, "UIPropertyDialog", modal, UIPropertyDialog.SMALL);
}
public boolean doApplyAction(Event e, Object o) {
System.out.println("Doing ApplyAction");
return true;
}
public boolean doCancelAction(Event e, Object o) {
System.out.println("Doing CancelAction");
return true;
}
public boolean doOKAction(Event e, Object o) {
System.out.println("Doing OKAction");
return true;
}
}
class myPage extends UIPropertyPage
{
myPage(UIPropertyDialog dialog)
{
super(dialog);
}
public boolean isApplyable() {
return true;
}
public boolean addContent()
{
add(new UIText("This is UIPropertySheet"));
return true;
}
}
Additional query words: AFC, UIPropertyDialog
Keywords: kbbug kbjafc kbpending KB201484