FileDocCategorySizeDatePackage
MediaPlayerRTPDialog.javaAPI DocJMF 2.1.1e3044Mon May 12 12:20:44 BST 2003javax.media.bean.playerbean

MediaPlayerRTPDialog

public class MediaPlayerRTPDialog extends Dialog
A Dialog for setting up RTP parameters. Invoked by Java Beans Special Editor MediaPlayerMediaLocationEditor.java

Fields Summary
TextField
IPAdrFld
TextField
PortFld
TextField
ttlFld
Choice
cbFormat
Button
OKButton
Button
CancelButton
String
rtpString
Constructors Summary
public MediaPlayerRTPDialog(Frame frame)
Constructs an RTP dialog using the specified Frame.

param
frame The Frame for the dialog.

    
  
                   
    
     
  
    super (frame, true);
    setTitle("Setup RTP Session");
    setBackground(Color.lightGray);
    addWindowListener(new WindowAdapter() {
	    public void windowClosing(WindowEvent e) {
		    cancel();
	    }
  	});
	
	setLayout(new BorderLayout());
	Panel row1 = new Panel();
	row1.setLayout(new FlowLayout());
	row1.add(new Label("IP Address"));
	IPAdrFld = new TextField("",24);
	row1.add(IPAdrFld);
	row1.add(new Label("Media Type"),Label.RIGHT);
	cbFormat= new Choice();
	cbFormat.removeAll();
	row1.add(cbFormat);
	cbFormat.addItem("audio");
	cbFormat.addItem("video");
	Dimension d= cbFormat.getSize();
	d.width=40;
	cbFormat.setSize(d);
	add("North", row1);
	Panel row2 = new Panel();
	add("Center", row2);
	row2.setLayout(new FlowLayout());
	row2.add(new Label("Port "));
	PortFld = new TextField("",8);
	row2.add(PortFld);
	row2.add(new Label("Time to live"));
	ttlFld = new TextField("", 3);
	row2.add(ttlFld);
	Panel row3 = new Panel();
	add("South", row3);
	row3.setLayout(new FlowLayout());
	OKButton = new Button("OK");
	row3.add(OKButton);
	CancelButton = new Button("Cancel");
	row3.add(CancelButton);
	OKButton.addActionListener(new ActionListener() {
	    public void actionPerformed(ActionEvent e) {
		close();
	    }
	});
	
	CancelButton.addActionListener(new ActionListener() {
	    public void actionPerformed(ActionEvent e) {
		cancel();
	    }
	});
	setLocation(200,300);
	setResizable(false);
	pack();
  
Methods Summary
private voidcancel()

    rtpString = "";
    dispose();
  
private voidclose()

    setRTPAdr();
    dispose();
  
public java.lang.StringgetRTPAdr()
Gets the RTP address for the dialog.

return
A String that contains the RTP address.

    return rtpString;
  
private voidsetRTPAdr()

    rtpString=IPAdrFld.getText()+":"+PortFld.getText()+"/"+cbFormat.getSelectedItem()+"/"+ttlFld.getText();