I am wondering how I can make my Java game automatically check for updates when a button is pressed, I have an ActionListener
calling my UpdateGUI
class:
btnUpdate.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
new UpdateGUI();
}
});
and then I am stuck from here on, I've got the GUI sorted (labels, buttons etc), but it's just the update checker, I also would like help to make a label appear when an update is available.
I have tried looking through the various questions provided to me as I was making this question, all of which did not help me.
UpdateGUI Code
public class UpdateGUI {
public UpdateGUI() {
JFrame starGameUpdater = new JFrame();
starGameUpdater.setTitle("StarGame Updater");
starGameUpdater.getContentPane().setLayout(null);
JLabel labelStargameUpdate = new JLabel("StarGame Updater");
labelStargameUpdate.setHorizontalAlignment(SwingConstants.CENTER);
labelStargameUpdate.setBounds(165, 11, 94, 14);
starGameUpdater.getContentPane().add(labelStargameUpdate);
}
}