/** @return the pot */ public static int getPort() { int port = 0; try { port = Integer.parseInt(pot.getText()); } catch (NumberFormatException f) { f.printStackTrace(); new WhatIDo("Entrer un port valide", f.toString()); } return port; }
public void actionPerformed(ActionEvent e) { JTextField fieldEdited = (JTextField) e.getSource(); try { systemOrder = Integer.parseInt(fieldEdited.getText()); } catch (NumberFormatException nfex) { System.out.println("Number format exception in getting system order"); nfex.printStackTrace(); } String updatedStatusText = prepareStatusText(); statusAreaTop.setText(updatedStatusText); }