Jon Brehmer

Greenhorn
+ Follow
since Feb 12, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jon Brehmer

package App.java;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class App extends Frame {
Label message = new Label("");
public static void main(String[] args) {
App myWindow = new App("Find the active window");
myWindow.setSize(250,150);
myWindow.setVisible(true);
}
public App(String title) {
super(title);
setLayout(new BorderLayout());
addWindowListener(
new WindowAdapter() {
public void windowActivated(WindowEvent e) {
message.setBackground(Color.red);
message.setText("I'm active");
}
public void windowDeactivated(WindowEvent e) {
message.setBackground(Color.lightGray);
message.setText("I'm not active");
}
public void windowIconified(WindowEvent e) {
message.setText("I've been crush");
}
public void windowClosing(WindowEvent e) {
System.out.println("I'm toast!");
dispose();
System.exit(0);
}
}
);
setForeground(Color.white);
setFont(new Font("SanSerif", Font.ITALIC, 24));
message.setAlignment(Label.CENTER);
add(message);
}
}
I'm trying to change the title of the window when it's minimized.
I know that you need to use windowIconified() but I cannot seemed to find a statement that will change the title of window when Iconified.
Can someone help me??
Thank you,
-Jon
20 years ago