70Views1Replies

Author Options:

Java IDE Help With Code Answered

Hey, i need help with a java code i just wrote up.
Here it is:

import java.awt.*;
import javax.swing.*;
import java.util.*;
public class Main extends JFrame {

public static void main(String[] args) {

  JFrame gui = JFrame;
  JLabel txt = JLabel("", JLabel.CENTER);
  Random t = new Random();
  int c;
   for (c = 1; c <= 1; c++) {
  gui.JLabel answer = new JLabel("");
  Main();
    gui.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    gui.setVisible(true);
    txt.setText(t.nextInt(50));
         }
    }
}

Thanks.

Comments

The forums are retiring in 2021 and are now closed for new topics and comments.