RSMasterGuard 19 Share Posted May 12, 2022 Thank you so much for the GUI guide. I have got a GUI working because of this but see the following warning about this GUI have performance issues, is there something wrong with my code, its being called via the onStart method? private void createGUI() { JFrame frame = new JFrame(); frame.setTitle("Al Kharid Beer Glass Collector"); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.setLocationRelativeTo(getClient().getInstance().getCanvas()); frame.setPreferredSize(new Dimension(400,50)); frame.getContentPane().setLayout(new BorderLayout()); JPanel settingPanel = new JPanel(); settingPanel.setLayout(new GridLayout(0,1)); JCheckBox lootBronzeMace = new JCheckBox(); lootBronzeMace.setText("Pick up Bronze Maces"); settingPanel.add(lootBronzeMace); lootBronzeMace.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { LootBronzeMaces = lootBronzeMace.isSelected(); } }); frame.getContentPane().add(settingPanel, BorderLayout.NORTH); frame.pack(); frame.setVisible(true); } Link to comment Share on other sites More sharing options...
pakruojinis 11 Share Posted May 12, 2022 5 hours ago, RSMasterGuard said: Thank you so much for the GUI guide. I have got a GUI working because of this but see the following warning about this GUI have performance issues, is there something wrong with my code, its being called via the onStart method? private void createGUI() { JFrame frame = new JFrame(); frame.setTitle("Al Kharid Beer Glass Collector"); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.setLocationRelativeTo(getClient().getInstance().getCanvas()); frame.setPreferredSize(new Dimension(400,50)); frame.getContentPane().setLayout(new BorderLayout()); JPanel settingPanel = new JPanel(); settingPanel.setLayout(new GridLayout(0,1)); JCheckBox lootBronzeMace = new JCheckBox(); lootBronzeMace.setText("Pick up Bronze Maces"); settingPanel.add(lootBronzeMace); lootBronzeMace.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { LootBronzeMaces = lootBronzeMace.isSelected(); } }); frame.getContentPane().add(settingPanel, BorderLayout.NORTH); frame.pack(); frame.setVisible(true); } https://dreambot.org/guides/scripter-guide/troubleshooting/ RSMasterGuard 1 Link to comment Share on other sites More sharing options...
CyanCipher 1 Share Posted November 16, 2022 is this guide updated for Dreambot 3 API? if not, please update it 😃 Link to comment Share on other sites More sharing options...
inch44 0 Share Posted December 25, 2022 (edited) ih Edited December 25, 2022 by inch44 Link to comment Share on other sites More sharing options...
arrlength 0 Share Posted January 16, 2023 Thank you for the walkthrough, very useful. Where are you getting the getClient method in frame.setLocationRelativeTo call in createGUI method? Link to comment Share on other sites More sharing options...
Hashtag 8670 Author Share Posted January 16, 2023 47 minutes ago, arrlength said: Thank you for the walkthrough, very useful. Where are you getting the getClient method in frame.setLocationRelativeTo call in createGUI method? That's old API way to access the Client class. Now you can statically reference to the public fields and methods in Client. ImLife 1 Link to comment Share on other sites More sharing options...
Hashtag 8670 Author Share Posted January 16, 2023 On 11/17/2022 at 12:29 AM, CyanCipher said: is this guide updated for Dreambot 3 API? if not, please update it 😃 This is for the old API. I'm afraid I don't have the time to update it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now