Code example for Properties

Methods: clear, setProperty

0
		super(title);
		createUI(); 
	} 
 
	Properties fillProperties(){
		props.clear();
		props.setProperty("action", "launchapplication");
		props.setProperty("windowid", "windowObject");
		props.setProperty("componentid", "childObject");
		props.setProperty("param1", "any parameter");
		props.setProperty("recordtype", "t");
		return props;
	} 
	 
	void createUI(){		 
		setTitle(getListenerName()); 
		setName(getListenerName()); 
		getAccessibleContext().setAccessibleName(getListenerName()); 
		 
		controls = new JPanel();
		 
		cmdLabel = new JLabel("Command:");
		cmdField = new JTextField();
		cmdField.setEditable(false);
		cmdField.setEnabled(false);
		cmdField.setMinimumSize(new Dimension(350,18));
		cmdField.setPreferredSize(cmdField.getMinimumSize());
		sendButton = new JButton("Send");
		sendButton.setActionCommand(sendAction);
		sendButton.addActionListener(this);
		sendButton.setEnabled(false);
		connectButton = new JButton("Connect");
		connectButton.setActionCommand(connectAction);
		connectButton.addActionListener(this);
		connectButton.setEnabled(true);
		shutdownButton = new JButton("Shutdown");
		shutdownButton.setActionCommand(shutdownAction);
		shutdownButton.addActionListener(this);
		shutdownButton.setEnabled(false);
		dispatchPropsButton = new JButton("Dispatch");
		dispatchPropsButton.setActionCommand(dispatchPropsAction);
		dispatchPropsButton.addActionListener(this);
		dispatchPropsButton.setEnabled(false);
		 
		controls.add(cmdLabel);
		controls.add(cmdField);
		controls.add(sendButton);
		controls.add(dispatchPropsButton);
		controls.add(shutdownButton);
		controls.add(connectButton);
		getContentPane().add(controls, "North");
		 
		status = new JTextField();
		status.setEditable(false);
		 
		getContentPane().add(status, "South");
		pack(); 
		int y = getHeight();
		//setSize(320 + 250,y); 
		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); 
		setVisible(true); 
		setFocusableWindowState(true); 
	} 
	 
	void onConnectAction(){ 
		disableInteraction(); 
		status.setText("Attempting Remote Server Connection...");
		server = new SoloRemoteControl();
		server.addListener(this);
		server.start();
	} 
	 
	void onSendAction(){ 
		disableInteraction(); 
		status.setText("Attempting sendMessage: "+ cmdField.getText());
		try{ 
			server.performRemoteMessageCommand(cmdField.getText(), 3, 3);
		} 
		catch(IllegalThreadStateException x){ 
			 
		} 
		catch(RemoteException x){ 
			 
		} 
		catch(TimeoutException x){ 
			 
		} 
		catch(ShutdownInvocationException x){
			 
		} 
	} 
	 
	void onDispatchPropsAction(){ 
		try{  
			server.performRemotePropsCommand(fillProperties(), 3, 3, 5); 
		} 
		catch(IllegalThreadStateException x){ 
			 
		} 
		catch(RemoteException x){