public void actionPerformed(ActionEvent e) { if (e.getSource() == a) { String str = label.getText(); min = Integer.parseInt(str); int x2 = (Integer.parseInt(str) + max) / 2; label.setText(x2 + ""); } if (e.getSource() == b) { String str = label.getText(); max = Integer.parseInt(str); int x2 = (Integer.parseInt(str) + min) / 2; label.setText(x2 + ""); } if (e.getSource() == c) { label.setText("50"); min = 0; max = 100; } }
public void actionPerformed(ActionEvent e) { if (e.getSource() == btn_Delete_Yes) { if (createOut) { BookModel umm = new BookModel(); umm.setBookId(Integer.parseInt(latxtId.getText())); umm.setBookName(txtName.getText()); umm.setBookPrice(Integer.parseInt(txtPrice.getText())); // umm.getBookWriter(cho.getItem(cho.getSelectedIndex())); BookSaveFactory.getInstance().create(umm); this.removeAll(); this.add(new BookList(f, "耶紗撹孔")); } } else if (e.getSource() == btn_Delete_No) { this.removeAll(); this.add(new BookList(f, "耶紗函�")); } else if (e.getSource() == btn_Delete_PriceIn) { NumAllPrice = Integer.parseInt(txtPrice.getText()) * Integer.parseInt(txtNum.getText()); lachoAllPrice.setText(NumAllPrice + ""); createOut = true; } }
public int getValue() { return (new Integer(value.getText())).intValue(); }