改编 java 窗口(追加10)

来源:百度知道 编辑:UC知道 时间:2024/06/11 05:20:09
import javax.swing.*;
import java.awt.*;

/**
* @version 1.32 2007-06-12
* @author Cay Horstmann
*/
public class NotHelloWorld
{
public static void main(String[] args)
{
EventQueue.invokeLater(new Runnable()
{
public void run()
{
NotHelloWorldFrame frame = new NotHelloWorldFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
});
}
}

/**
* A frame that contains a message panel
*/
class NotHelloWorldFrame extends JFrame
{
public NotHelloWorldFrame()
{
setTitle("NotHelloWorld");
setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);

// add panel to frame

NotHelloWorldPanel panel = new NotHelloWorldPanel();
add(panel);

import java.awt.event.ActionEvent;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.image.BufferedImage;

/**
* @version 1.32 2007-06-12
* @author Cay Horstmann
*/
class NotHelloWorld {

public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {

public void run() {
NotHelloWorldFrame frame = new NotHelloWorldFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
});
}
}

/**
* A frame that contains a message panel
*/
class NotHelloWorldFrame extends JFrame {

public NotHelloWorldFrame() {
setTitle("NotHelloWorld");
setSize(DEFA