/** @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); }
public void actionPerformed(ActionEvent e) { if (e.getSource() == cancel) dispose(); else try { long wohin = Long.parseLong(postf.getText(), 16); long wieweit = Long.parseLong(sizetf.getText(), 16); if (parent.hv.goTo(wohin, wieweit)) dispose(); } catch (NumberFormatException ex) { postf.setText(ex.toString()); return; } }