public static DatabaseType insertStockValue(JFrame frame){
        JPanel panel = new JPanel(new BorderLayout(5, 5));

        JPanel label = new JPanel(new GridLayout(5, 1, 2, 2));
        label.add(new JLabel("Time", SwingConstants.RIGHT));
        label.add(new JLabel("Company market code", SwingConstants.RIGHT));
        label.add(new JLabel("Title number", SwingConstants.RIGHT));
        label.add(new JLabel("Current value", SwingConstants.RIGHT));
        label.add(new JLabel("Currency", SwingConstants.RIGHT));
        panel.add(label, BorderLayout.WEST);

        JPanel controls = new JPanel(new GridLayout(5, 1, 2, 2));
        
        JTextField timeF = new JTextField();
        timeF.setToolTipText("Insert the time, in the form YYYY-MM-DD!");
        TextPrompt timeP = new TextPrompt("2013-08-20", timeF);
        timeP.setForeground( Color.RED );
        timeP.changeAlpha(0.5f);
        timeP.changeStyle(Font.BOLD + Font.ITALIC);
        controls.add(timeF);
        
        JTextField market_codeF = new JTextField();
        market_codeF.setToolTipText("Type the market code of the bank where this account is stored at. Like RT.b");
        TextPrompt market_codeP = new TextPrompt("RBS.L", market_codeF);
        market_codeP.setForeground( Color.RED );
        market_codeP.changeAlpha(0.5f);
        market_codeP.changeStyle(Font.BOLD + Font.ITALIC);
        controls.add(market_codeF);
        
        JTextField titleF = new JTextField();
        titleF.setToolTipText("Insert the title number, which should be an integer number!");
        TextPrompt titleP = new TextPrompt("12345", titleF);
        titleP.setForeground( Color.RED );
        titleP.changeAlpha(0.5f);
        titleP.changeStyle(Font.BOLD + Font.ITALIC);
        controls.add(titleF);
        
        JTextField valueF = new JTextField();
        valueF.setToolTipText("Insert the value at that time, as a floating point number.");
        TextPrompt valueP = new TextPrompt("54.56", valueF);
        valueP.setForeground( Color.RED );
        valueP.changeAlpha(0.5f);
        valueP.changeStyle(Font.BOLD + Font.ITALIC);
        controls.add(valueF);
        
        JTextField currencyF = new JTextField();
        currencyF.setToolTipText("Type the currency of the state you live in.");
        TextPrompt currencyP = new TextPrompt("EUR", currencyF);
        currencyP.setForeground( Color.RED );
        currencyP.changeAlpha(0.5f);
        currencyP.changeStyle(Font.BOLD + Font.ITALIC);
        controls.add(currencyF);
        
        
        controls.setPreferredSize(new Dimension(300, 180));
        panel.add(controls, BorderLayout.CENTER);

        while(JOptionPane.showConfirmDialog(frame, panel, "Add", JOptionPane.OK_CANCEL_OPTION) == 0){
        	String time = timeF.getText();
        	String market_code = market_codeF.getText().toUpperCase();
        	String title = titleF.getText();
        	String value = valueF.getText();
        	String currency = currencyF.getText().toUpperCase();
        	
        	//Checks
        	boolean validData = true;
        	try{
        		Double.parseDouble(value);
        	} catch (Exception e){
        		validData = false;
        		JOptionPane.showMessageDialog(frame, "Value must be floating point number!");
        	}
        	try{
        		Integer.parseInt(title);
        	} catch (Exception e){
        		validData = false;
        		JOptionPane.showMessageDialog(frame, "Title number must be integer value!");
        	}
        	if(!time.matches("[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}")){
        		JOptionPane.showMessageDialog(frame, "Time should be of the format 'YYYY-MM-DD'");
        		validData = false;
        	}
        	if(market_code.length()>10 || !market_code.matches("[A-z]+|[A-z]+.[A-z]+")){
        		JOptionPane.showMessageDialog(frame, "Market code maximum allowed 10 alphabetical characters + the dot (.) sign!");
        		validData = false;
        	}
        	if(currency.length()>3 || !currency.matches("[A-z]+")){
        		JOptionPane.showMessageDialog(frame, "Currency should be 3 char max. and only literals, such as EUR or GBP!");
        		validData = false;
        	}
        	
        	//If entered data is valid, return account type.
        	if(validData){
        		return new StockValue(time, market_code, Integer.parseInt(title), Double.parseDouble(value), currency);
        	}
        }
        return null;
	}