当前位置: 技术问答>java相关
一段很简单的代码,高手帮忙看下!
来源: 互联网 发布时间:2015-09-11
本文导语: 代码: import java.awt.*; import java.awt.event.*; import javax.swing.*; class BabyFace extends Frame { private JLabel face; private JButton lButton, rButton; private BorderLayout layout; private String names[] = {"image1.gif","image2.gif"...
代码:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class BabyFace extends Frame {
private JLabel face;
private JButton lButton, rButton;
private BorderLayout layout;
private String names[] =
{"image1.gif","image2.gif","image3.gif","image4.gif"};
private Icon img[];
public BabyFace() {
super( "Baby Face");
//layout = new BorderLayout();
Container c = getContentPane();
c.setLayout( new FlowLayout() );
Icon image = new ImageIcon("image1.gif");
lButton = new JButton( ">" );
img = new Icon[4];
for ( int i = 0; i
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
class BabyFace extends Frame {
private JLabel face;
private JButton lButton, rButton;
private BorderLayout layout;
private String names[] =
{"image1.gif","image2.gif","image3.gif","image4.gif"};
private Icon img[];
public BabyFace() {
super( "Baby Face");
//layout = new BorderLayout();
Container c = getContentPane();
c.setLayout( new FlowLayout() );
Icon image = new ImageIcon("image1.gif");
lButton = new JButton( ">" );
img = new Icon[4];
for ( int i = 0; i