Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   *  Copyright (c) 2011 Leibniz Institute of Plant Genetics and Crop Plant Research (IPK), Gatersleben, Germany.
   *  All rights reserved. This program and the accompanying materials
   *  are made available under the terms of the GNU Lesser Public License v2.1
   *  which accompanies this distribution, and is available at
   *  http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
   *
   *  Contributors:
   *      Leibniz Institute of Plant Genetics and Crop Plant Research (IPK), Gatersleben, Germany - RMI Client, FileChooser and WebDAV
  */
 package de.ipk_gatersleben.bit.bi.edal.publication;
 
 import java.awt.Frame;
 
 
Create a Dialog if there is an problem with the connection to the eDAL server and ask the user if the system should retry or quit the connection try.

Author(s):
arendd
 
 public class ServerErrorDialog extends JDialog implements ActionListener {
 
 	private static final long serialVersionUID = 2288426728436421340L;
 
 	private JButton retryButton = new JButton("RETRY");
 	private JButton cancelButton = new JButton("CANCEL");
 
 	private int returnValue = 0;
 
 	public ServerErrorDialog(Frame parentString errorMessage) {
 
 		super(parent.true);
 		this.setFocusable(true);
 
 		JEditorPane textPane = new JEditorPane();
 
 		textPane.setContentType("text/html");
 
 		try {
 			textPane.setText(PublicationVeloCityCreater
 					.generateServerErrorDialog(errorMessage));
 		} catch (EdalException e) {
 		}
 
 		textPane.setEditable(false);
 		textPane.setBorder(BorderFactory.createEmptyBorder());
 
 		JPanel buttonPanel = new JPanel();
 		buttonPanel.add();
 		buttonPanel.add();
 
 		JPanel mainPanel = new JPanel();
 		mainPanel.setLayout(new BoxLayout(mainPanel.));
 		mainPanel.add(textPane);
 		mainPanel.add(buttonPanel);
 
 		this.setContentPane(mainPanel);
 		this.setResizable(false);
 		this.setPreferredSize(new Dimension(500, 200));
 		this.pack();
 		this.setLocationRelativeTo(parent);
 	}
 
 	public void actionPerformed(ActionEvent actionEvent) {
 
 		if (actionEvent.getSource().equals(this.)) {
 			this. = 1;
 			this.dispose();
 		}
 
 		else if (actionEvent.getSource().equals(this.)) {
 			this. = 0;
 			this.dispose();
 		}
 	}

Returns:
the returnValue
 
 	public int getReturnValue() {
 		return ;
	}
	public Object showDialog() {
		return this;
	}
New to GrepCode? Check out our FAQ X