当前位置: 技术问答>java相关
请问怎样在Applet中加上标题菜单?
来源: 互联网 发布时间:2015-03-12
本文导语: 谢谢!!! | eform.java --------------------------------------------------- import java.awt.*; import java.awt.event.*; import javax.swing.*; public class eform extends JApplet { Icon dukeStanding = new ImageIcon("duke_standing.gif...
谢谢!!!
|
eform.java
---------------------------------------------------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class eform extends JApplet {
Icon
dukeStanding = new ImageIcon("duke_standing.gif"),
dukeWaving = new ImageIcon("duke_waving.gif"),
dukeStandingSmall =
new ImageIcon("duke_standing_small.gif"),
dukeWavingSmall = new ImageIcon("duke_waving_small.gif");
public void init() {
Container contentPane = getContentPane();
Action[] actions = {
new NewAction(),
new OpenAction(),
new CutAction(),
new CopyAction(),
new PasteAction(),
new ExitAction()
};
JToolBar toolbar = new JToolBar();
JMenuBar menubar = new JMenuBar();
JMenu fileMenu = new JMenu("File");
JRadioButton
menubarDuke = new JRadioButton(dukeStandingSmall),
menuDuke = new JRadioButton(dukeStandingSmall),
toolbarDuke = new JRadioButton(dukeStanding);
menuDuke.setRolloverIcon(dukeWavingSmall);
menubarDuke.setRolloverIcon(dukeWavingSmall);
toolbarDuke.setRolloverIcon(dukeWaving);
menubar.add(menubarDuke);
toolbar.add(toolbarDuke);
fileMenu.add(menuDuke);
for(int i=0; i
---------------------------------------------------
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class eform extends JApplet {
Icon
dukeStanding = new ImageIcon("duke_standing.gif"),
dukeWaving = new ImageIcon("duke_waving.gif"),
dukeStandingSmall =
new ImageIcon("duke_standing_small.gif"),
dukeWavingSmall = new ImageIcon("duke_waving_small.gif");
public void init() {
Container contentPane = getContentPane();
Action[] actions = {
new NewAction(),
new OpenAction(),
new CutAction(),
new CopyAction(),
new PasteAction(),
new ExitAction()
};
JToolBar toolbar = new JToolBar();
JMenuBar menubar = new JMenuBar();
JMenu fileMenu = new JMenu("File");
JRadioButton
menubarDuke = new JRadioButton(dukeStandingSmall),
menuDuke = new JRadioButton(dukeStandingSmall),
toolbarDuke = new JRadioButton(dukeStanding);
menuDuke.setRolloverIcon(dukeWavingSmall);
menubarDuke.setRolloverIcon(dukeWavingSmall);
toolbarDuke.setRolloverIcon(dukeWaving);
menubar.add(menubarDuke);
toolbar.add(toolbarDuke);
fileMenu.add(menuDuke);
for(int i=0; i