Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String highestBid(String paintingID) {
- int x = 1;
- int count = 0;
- try {
- for (Bid b : bid) {
- if (paintingID.equals(b.getPaintingID())) {
- x = b.getPrice();
- count++;
- }
- }
- } catch (Exception ex) {
- return ex.getMessage();
- }
- if (count == 0) {
- return "n" + "Invalid Painting ID. There is no Painting with this ID!";
- } else {
- return paintingID;
- }
- }
- public void actionPerformed(ActionEvent e) {
- if (e.getSource() == tfPid)
- taText.setText("");
- String paintingID = tfPid.getText();
- taText.setText(taText.getText()+a.highestBid(paintingID));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement