GridBagLayout
Publicado por diogenes (7 intervenciones) el 06/12/2004 00:28:55
Tengo el siguiente codigo donde quise agregar
la clase GridBagLayout pero me encontre con el problema
que al compilar me dio el siguiente mensaje
Method setLayout(java.awtGridBagLayout) not found in class Tarea2
y tambien
Method setForeground(java.awtColor) not found in class Tarea2
Cualquiera ayuda se las agradecere
el codigo es el siguiente
import java.awt.Font;
import java.awt.Graphics;
import java.awt.FontMetrics;
import java.util.ArrayList; import java.awt.*;
class Tarea2 {
Button Buttonokb,open,close;
Font tit = new Font("Courier", Font.BOLD, 16);
Font nor = new Font("Arial", Font.PLAIN, 10);
String lolo,lula;
TextField tfname = new TextField(20);
TextField tfpass = new TextField(20);
Frame window;
void buildConstraints(GridBagConstraints gbc, int gx, int gy,
int gw, int gh, int wx, int wy) {
gbc.gridx = gx;
gbc.gridy = gy;
gbc.gridwidth = gw;
gbc.gridheight = gh;
gbc.weightx = wx;
gbc.weighty = wy;
}
public static void main(String arg[]) throws InterruptedException { GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints constraints = new GridBagConstraints();
setLayout(gridbag);
setForeground(Color.blue);
System.out.println("Comienza main()...");
la clase GridBagLayout pero me encontre con el problema
que al compilar me dio el siguiente mensaje
Method setLayout(java.awtGridBagLayout) not found in class Tarea2
y tambien
Method setForeground(java.awtColor) not found in class Tarea2
Cualquiera ayuda se las agradecere
el codigo es el siguiente
import java.awt.Font;
import java.awt.Graphics;
import java.awt.FontMetrics;
import java.util.ArrayList; import java.awt.*;
class Tarea2 {
Button Buttonokb,open,close;
Font tit = new Font("Courier", Font.BOLD, 16);
Font nor = new Font("Arial", Font.PLAIN, 10);
String lolo,lula;
TextField tfname = new TextField(20);
TextField tfpass = new TextField(20);
Frame window;
void buildConstraints(GridBagConstraints gbc, int gx, int gy,
int gw, int gh, int wx, int wy) {
gbc.gridx = gx;
gbc.gridy = gy;
gbc.gridwidth = gw;
gbc.gridheight = gh;
gbc.weightx = wx;
gbc.weighty = wy;
}
public static void main(String arg[]) throws InterruptedException { GridBagLayout gridbag = new GridBagLayout();
GridBagConstraints constraints = new GridBagConstraints();
setLayout(gridbag);
setForeground(Color.blue);
System.out.println("Comienza main()...");
Valora esta pregunta


0