public void showNetworkIPDialog(){
		final JDialog in = new JDialog(this,"Send to GCodeSimulator/GCodePrintr for Android",true);
		in.setLayout(new FlowLayout());
		in.setBackground(Color.lightGray);
		final JTextField tf2 = new JTextField(15);
		final JLabel status = new JLabel("                                                    ");
		tf2.setText(networkip);
//		tf2.setSize(200,20);
		JButton btn1 = new JButton("Send");
		JButton btn2 = new JButton("Cancel");
		final JCheckBox autostart = new JCheckBox("Autostart Print");
		final JCheckBox autosave = new JCheckBox("Autosave File");
		
		btn2.setActionCommand("Cancel");
		
		in.addWindowListener(new WindowListener() {			
			@Override
			public void windowOpened(WindowEvent arg0) {}			
			@Override
			public void windowIconified(WindowEvent arg0) {	}			
			@Override
			public void windowDeiconified(WindowEvent arg0) {}			
			@Override
			public void windowDeactivated(WindowEvent arg0) {}			
			@Override
			public void windowClosing(WindowEvent arg0) {
				in.setVisible(false);				
			}			
			@Override
			public void windowClosed(WindowEvent arg0) {
				in.setVisible(false);				
			}			
			@Override
			public void windowActivated(WindowEvent arg0) {	}
		});
		ActionListener action= new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				if(e.getActionCommand().equals("Cancel")){
					in.dispose();
					return;
				}
				try {
					NetworkPrinter netp = new NetworkPrinter();
					status.setText("Sending file ... please wait");
					in.repaint();
					networkip=tf2.getText();
					storeConfig();
					int flags=0;
					if(autostart.isSelected()){ flags = (flags | NetworkPrinter.AUTOSTART_PRINT);}
					if(autosave.isSelected()){ flags = (flags | NetworkPrinter.AUTOSAVE_MODEL);}
					netp.sendToReceiver(networkip, gp.model,flags);					
					status.setText("Sending file ... done");
					in.repaint();
					in.setVisible(false);
				}catch (UnknownHostException uh){
					status.setText("Invalid IP address:"+uh.getMessage());
					in.repaint();
					//uh.printStackTrace();
				}catch(ConnectException ce) {
					status.setText("Connect error:"+ce.getMessage());
					in.repaint();
					//ce.printStackTrace();
				}catch (IOException e2) {
					status.setText("IO Error:"+e2.getMessage());
					in.repaint();
					//e2.printStackTrace();
				}catch (Exception e2) {
					status.setText("Error:"+e2.getMessage());
					in.repaint();
					//e2.printStackTrace();
				}
				
			}
		};
		btn1.addActionListener(action);
		btn2.addActionListener(action);
		tf2.addActionListener(action);
		in.add(new Label("Enter IP Address"));
		in.add(tf2);
		in.add(autostart);
		in.add(autosave);
		in.add(btn1);
		in.add(btn2);

		in.add(status);
		in.setSize(330,160);
		in.setVisible(true);
	}