Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class PlayButton {
- public JButton play = getButton();
- private JButton getButton(){
- JButton button = new JButton("Играть");
- button.setSize(100,50);
- button.setMaximumSize(button.getSize());
- button.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- if(Desktop.isDesktopSupported()){
- Desktop desktop = Desktop.getDesktop();
- try {
- desktop.open(new File("C:\\Users\\Oleg\\AppData\\Roaming\\minecraft.exe"));
- } catch (IOException e1) {
- e1.printStackTrace();
- }
- }
- }
- });
- return button;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement