简体   繁体   中英

Error Cannot find Symbol Main(); Line 20 Symbol: Method Main() Location class Main 1 error

import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.lang.*;

public class Main extends Frame 
{
 Label SourceLabelL  = new Label("source");
 Label SourceLabel   = new Label("");
 Label TargetLabel   = new Label("");
     Label FileNameLabel = new Label("File Name: ");
 Button TargeButton  = new Button("Target");
     Button OKButton     = new Button("OK   ");
 GridBagLayout gbl;
 GridBagConstraints c;
 public static void main(String[] args)
{
    Main m = new Main();
}
Main()
 {
     gbl = new GridBagLayout();
     c = new GridBagConstraints();
    int colwidth[]={1,1,1,1,1,1,1,1};
    int colheight[]={1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};  // theres 18
    double colweightb[]={1,1,1,1,1,1,1,1};
    gbl.SetLayout(Display);
    gbl.SetBounds(0,0,300,900);

Cannot Find Symbol gbl.SetLayout(Display); Symbol: variable Display Location: class Main I'm not sure what to do here. any help would surely be nice

If you are trying to create a instance of class Main then the syntax should be :

 Main m = new Main();

Main() is the constructor of class Main

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM