You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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");
}
}
The text was updated successfully, but these errors were encountered:
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:
/*
*/
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());
}
The text was updated successfully, but these errors were encountered: