FileDocCategorySizeDatePackage
OpenUrlDialog.javaAPI DocJMF 2.1.1e2469Mon May 12 12:20:32 BST 2003jmapps.jmstudio

OpenUrlDialog

public class OpenUrlDialog extends JMDialog

Fields Summary
public static final String
LABEL
private TextField
fieldUrl
private String
nameUrlDefault
Constructors Summary
public OpenUrlDialog(Frame frame, String nameUrlDefault)



            
        super ( frame, JMFI18N.getResource("jmstudio.openurl.title"), true );

        this.nameUrlDefault = nameUrlDefault;
        try {
            init();
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    
Methods Summary
public voidactionPerformed(java.awt.event.ActionEvent event)

        String      strAction;
        Object      objSource;

        strAction = event.getActionCommand ();
        objSource = event.getSource ();
        if ( strAction.equals(ACTION_OPEN) ) {
            this.setAction ( strAction );
            this.dispose ();
        }
        else if ( strAction.equals(ACTION_CANCEL) ) {
            this.setAction ( strAction );
            this.dispose ();
        }
        else if ( objSource == fieldUrl ) {
            this.setAction ( ACTION_OPEN );
            this.dispose ();
        }
    
public java.lang.StringgetUrl()

        String  nameUrl;

        nameUrl = fieldUrl.getText ();
        return ( nameUrl );
    
protected voidinit()

        JMPanel     panel;
        JMPanel     panelButtons;
        Label       label;

	    setLayout ( new BorderLayout() );

        panel = new JMPanel ( new BorderLayout() );
        panel.setEmptyBorder ( 6, 6, 6, 6 );
        this.add ( panel, BorderLayout.CENTER );

        label = new Label ( LABEL );
        panel.add ( label, BorderLayout.WEST );

        if ( nameUrlDefault == null )
            nameUrlDefault = "";
	    fieldUrl = new TextField ( nameUrlDefault, 30 );
        fieldUrl.addActionListener ( this );
        panel.add ( fieldUrl, BorderLayout.CENTER );

        panel = new JMPanel ( new FlowLayout(FlowLayout.CENTER) );
        this.add ( panel, BorderLayout.SOUTH );
        panelButtons = createButtonPanel ( new String[] { ACTION_OPEN, ACTION_CANCEL } );
        panel.add ( panelButtons );

        this.pack ();
        this.setResizable ( false );