Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode keeps opening up instances when running code #234439

Open
Ale653 opened this issue Nov 22, 2024 · 0 comments
Open

VSCode keeps opening up instances when running code #234439

Ale653 opened this issue Nov 22, 2024 · 0 comments
Assignees

Comments

@Ale653
Copy link

Ale653 commented Nov 22, 2024

I just started using vscode on my macbook wich is running macos 15. I have been running code for a few times trying to figure out whats wrong burt I cannot find it. The code is:

/*

  • Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
    */

package com.mycompany.class_51;

/**
*

  • @author alous
    /
    import java.awt.
    ;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    public class Class_51 implements ActionListener{
    Label L;
    Class_51(){
    Frame F= new Frame();
    F.setSize(800, 400);
    F.setLayout(null);
    F.setVisible(true);

    // Action Listener means when you click on someyhing and then something happends, Action Listener is a simple click
    // There are three steps to use Action Listener 1. in the line inside rthe class 2. THen apply add Action Listener where we do need to click with "this" 3. Use Action Perfom function where we will do the coding what will hapend when action perfom is called.

//Mouse listener has different mouse properties(click, click and hold, click and drag, click, hold and release, hover ...)
Button B1= new Button("herksgfhilasdjhflajshdflkj");
B1.setBounds(100, 100, 50, 60);
F.add(B1);
B1.addActionListener(new Class_51());

L= new Label();
L.setBounds(200, 100, 50, 100);
F.add(L);

}
public static void main(String[] args) {
    System.out.println("Hello World!");
new Class_51();
}

@Override
public void actionPerformed(ActionEvent e) {
    L.setText("oieaYAYhqnoHURRAHurrarmhghsdfgb");

}

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants