i need to simplify my code
hi guys, i have a problem with my code, i can't do anything more (rules) because my code is complex and eventually unnecessarily
can anyone take a look?
Code:
ActionListener one = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (gr1.getCounter1() < 5) {
gr1.setCounter1(gr1.getCounter1() + 1);
test1.setIcon(play1a);
pn1.setText(Integer.toString(play2a));
pn5.setText(play3a);
pn50.setText(play4a);
} else {
pn5.setText("No more cards");
}
}
};
arraybtn[1].addActionListener(one);
arraybtn[1].setPreferredSize(new Dimension(120, 20));
play1a = hand.get(0).getImage();
play2a = hand.get(0).toInt();
play3a = hand.get(0).toString();
play4a = hand.get(0).suit();
arraybtn[1].setText(play3a);
arraybtn[1].setFont(new Font("sansserif", Font.BOLD, 7));