Hello people:
I am trying to create a ComponentListener method that will resize some components when the window is resized. I have tried the following code, only to find out that it didnt work:
import java.awt.event.*;
import java.awt.*;
public class PowerEvent {
PowerMath gui;
PowerEvent(PowerMath in) {
gui = in;
gui.addComponentListener(new ComponentAdapter() {
public void componentHidden(ComponentEvent e) {
}
public void componentMoved(ComponentEvent e) {
}
public void componentResized(ComponentEvent e) {
gui.output.setPreferredSize( new Dimension( gui.getWidth()-30, gui.getHeight()-80 ));
}
public void componentShown(ComponentEvent e) {
}
}
);
}
public void actionPerformed(ActionEvent evt) {
}
}
I would appreciate it if anyone could tell me how to fix my problem of the code not working or mabye suggest another method?
Thanks in advance,
mintsmike