Extends (Urgente) - Código fonte

2 respostas
H

package ergonosc;

import java.awt.<em>;

import java.awt.event.</em>;

import javax.swing.<em>;

import java.sql.</em>;
public class framebasico extends JDialog {

JPanel contentPane;

BorderLayout borderLayout1 = new BorderLayout();

Connection conn;
// construtor do frame

public framebasico(Connection c) {

enableEvents(AWTEvent.WINDOW_EVENT_MASK);

try {

framebasicoInit();

conn = c;

}

catch (Exception e) {

e.printStackTrace();

}

}
//Centraliza frame

public void center(){

Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();

Dimension frameSize = this.getSize();

if (frameSize.height > screenSize.height)

frameSize.height = screenSize.height;

if (frameSize.width > screenSize.width)

frameSize.width = screenSize.width;

this.setLocation((screenSize.width - frameSize.width) / 2,(screenSize.height - frameSize.height) / 2);

this.setVisible(true);

}

// Inicialização dos componentes
private void framebasicoInit() throws Exception {

contentPane = (JPanel) this.getContentPane();
contentPane.setLayout(borderLayout1);
this.setEnabled(true);
this.setModal(true);
this.setResizable(false);

}

}


package ergonosc;

import java.awt.<em>;

import java.awt.event.</em>;

import javax.swing.<em>;

import java.sql.</em>;
public class teste extends framebasico {

// construtor do frame

Connection conn;

public teste() {

super.framebasico(conn);

}

}

:cry: :cry: :cry: :cry:

2 Respostas

T

[color=“blue”]Após essas alterações que fiz, consegui compilar, o resto é com você…[/color]

[color="#444444"]package ergonosc;

import java.awt.<em>;

import java.awt.event.</em>;

import javax.swing.<em>;

import java.sql.</em>;
public class Teste extends FrameBasico {

// construtor do frame

static Connection conn;
public Teste()

{

super(conn);

}

} [/color]

[color=“blue”]***Espero ter te ajudado…[/color] :wink:

H

VALEU… :lol:

Criado 22 de julho de 2003
Ultima resposta 23 de jul. de 2003
Respostas 2
Participantes 2