private JPanel getMainPane() {
		if (mainPane == null) {
			mainPane = new JPanel();
			mainPane.setPreferredSize(new Dimension(600, 400));
			
			BoxLayout layout = new BoxLayout(mainPane, BoxLayout.Y_AXIS);
			mainPane.setLayout(layout);
			
			errorMsgLabel = new JLabel(" ");
			errorMsgLabel.setAlignmentX(Component.CENTER_ALIGNMENT);
			errorMsgLabel.setForeground(Color.RED);
			mainPane.add(errorMsgLabel);
			
			JLabel title = new JLabel(
				new javax.swing.ImageIcon(getClass().getResource(
							"/resource/title.png")));
			title.setAlignmentX(Component.CENTER_ALIGNMENT);
			mainPane.add(title);
			
			JPanel dbNamePane = new JPanel(new FlowLayout(FlowLayout.TRAILING));
			dbNamePane.add(new JLabel("Database name "));
			dbNamePane.add(getDbNameField());
			dbNamePane.add(new JLabel("                "));
			dbNamePane.setAlignmentX(Component.CENTER_ALIGNMENT);
			mainPane.add(dbNamePane,layout);
			
			JPanel dbAddPane = new JPanel(new FlowLayout(FlowLayout.TRAILING));
			dbAddPane.add(new JLabel("Database address "));
			dbAddPane.add(getDbAddressField());
			dbAddPane.add(new JLabel("                "));
			dbAddPane.setAlignmentX(Component.CENTER_ALIGNMENT);
			mainPane.add(dbAddPane,layout);
			
			JPanel portNumPane = new JPanel(new FlowLayout(FlowLayout.TRAILING));
			portNumPane.add(new JLabel("Port number "));
			portNumPane.add(getPortNumField());
			portNumPane.add(new JLabel("                "));
			portNumPane.setAlignmentX(Component.CENTER_ALIGNMENT);
			mainPane.add(portNumPane,layout);
			
			JPanel usernamePane = new JPanel(new FlowLayout(FlowLayout.TRAILING));
			usernamePane.add(new JLabel("Username "));
			usernamePane.add(getUsernameField());
			usernamePane.add(new JLabel("                "));
			usernamePane.setAlignmentX(Component.CENTER_ALIGNMENT);
			mainPane.add(usernamePane,layout);
			
			JPanel passwordPane = new JPanel(new FlowLayout(FlowLayout.TRAILING));
			passwordPane.add(new JLabel("Password "));
			passwordPane.add(getPasswordField());
			passwordPane.add(new JLabel("                "));
			passwordPane.setAlignmentX(Component.CENTER_ALIGNMENT);
			mainPane.add(passwordPane,layout);
			
			JButton con = getConnectButton();
			con.setAlignmentX(Component.CENTER_ALIGNMENT);
			mainPane.add(con);
			
			mainPane.add(Box.createRigidArea(new Dimension(0,40)));
		}
		return mainPane;
	}