[英]creating method in new class; cannot find symbol error in main class
[英]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);
無法找到符號gbl.SetLayout(顯示); 符號:變量顯示位置:類主要我不知道該怎么做。 任何幫助肯定會很好
如果您嘗試創建Main類的實例,則語法應為:
Main m = new Main();
Main()是Main類的構造函數
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.