Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Do not understand why the library is not working when imported

$
0
0
Here is my code:
package stilltryin;
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
public class StillTryin{
frame();}
public void frame(){
JFrame f = new JFrame();
f.setVisible(true);
f.setSize(240,240);
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
public static void main(String[] args){
StillTryin();}}

I am getting multiple errors about Class, Interface, or Enum expected from this code, but it makes no sense to me, :helpsmilie:/> because it seems to be focusing on the setSize, setVisible setDefaultCloseOperation,lines of my code, but I imported javax.swing.*; I am lost as to what is causing this, and it is becoming frustrating to me here. In any case, I have included an attachment with the errors I am getting in it. PLEASE HELP clear this up for me!! :surrender:/>


Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>