Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Tried making gui with tabs now script wont even start

Featured Replies

Hey so i tried making a GUI with tabs but now when i try to start my script nothing happens. the log does not say anything either.

I tried use JFormDesigner but couldnt get that to work so i checked out explvs guide i think it was.

suppose to looke like this

c1caaf97a978c79ffd42f44383c93bf4.png

SOLVED THANK YOU!

 

idk what im doing wrong :(

thank you for your help in  advance <3

Edited by skillerkidos1

  • Author
1 hour ago, Khaleesi said:

Have you put somthing in your .open() method?
Any errors?

No I had a simple GUI and it was working fine then I redid the GUI and now the script won’t start. The log in osbot does not say anything when I try to start the script. 
 

  1. public void open(){
  2. mainDialog.setVisible(true);
  3. }
  4.  
  5. public void close(){
  6. mainDialog.setVisible(false);
  7. mainDialog.dispose();
  8. }
  • Author
33 minutes ago, Nbacon said:

Were is JFrame frame?

(I think that is your problem)

Where would I put that? Originally I was following this guide here

 

Ok. I was mistaken on the Jpanel.Try this 

 mainDialog = new JDialog();
        mainDialog.setTitle("KO Corp");
        mainDialog.setModal(true);
        mainDialog.setLayout(new BoxLayout(mainDialog, BoxLayout.PAGE_AXIS));
        mainDialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);

        JPanel mainPanel = new JPanel();
        mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.PAGE_AXIS));
        mainDialog.getContentPane().add(mainPanel);
        
        
        
        JTabbedPane tabbedPane = new JTabbedPane();
        tabbedPane.setBorder(new EmptyBorder(15,15,15,15));
        mainPanel.add(tabbedPane);

(next time can you post the whole code so I/everone can run it)

Edited by Nbacon

  • Author
14 minutes ago, Nbacon said:

Ok. I was mistaken on the Jpanel.Try this 


 mainDialog = new JDialog();
        mainDialog.setTitle("KO Corp");
        mainDialog.setModal(true);
        mainDialog.setLayout(new BoxLayout(mainDialog, BoxLayout.PAGE_AXIS));
        mainDialog.setModalityType(Dialog.ModalityType.APPLICATION_MODAL);

        JPanel mainPanel = new JPanel();
        mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.PAGE_AXIS));
        mainDialog.getContentPane().add(mainPanel);
        
        
        
        JTabbedPane tabbedPane = new JTabbedPane();
        tabbedPane.setBorder(new EmptyBorder(15,15,15,15));
        mainPanel.add(tabbedPane);

(next time can you post the whole code so I/everone can run it)

https://pastebin.com/U0hmwKbZ
 

That’s all of it and I’ll try what you said when I get home I’m a few hours. Hopefully that will work!

Wow....

comment out... "mainDialog.setLayout(new BoxLayout(mainDialog, BoxLayout.PAGE_AXIS));"

works on my pc with this test code.

public class Main {


    public static void main(String[] args) {
        AtomicReference<GUI> gui = new AtomicReference<GUI>(new GUI());
        try {
            SwingUtilities.invokeAndWait(() -> {
                gui.set(new GUI());
                gui.get().open();
            });
        } catch (InterruptedException | InvocationTargetException e) {

            return;
        }

        System.out.println("Done");
    }


}

(linux so it might look different on windows/mac)

https://ibb.co/qFX15fW

  • Author
12 minutes ago, Nbacon said:

Wow....

comment out... "mainDialog.setLayout(new BoxLayout(mainDialog, BoxLayout.PAGE_AXIS));"

works on my pc with this test code.


public class Main {


    public static void main(String[] args) {
        AtomicReference<GUI> gui = new AtomicReference<GUI>(new GUI());
        try {
            SwingUtilities.invokeAndWait(() -> {
                gui.set(new GUI());
                gui.get().open();
            });
        } catch (InterruptedException | InvocationTargetException e) {

            return;
        }

        System.out.println("Done");
    }


}

(linux so it might look different on windows/mac)

https://ibb.co/qFX15fW

I love you ❤️❤️❤️❤️

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.