| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 600 人关注过本帖
标题:求助 在这个代码中怎么添加背景图片
取消只看楼主 加入收藏
liubooks2003
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2012-12-21
结帖率:0
收藏
已结贴  问题点数:20 回复次数:0 
求助 在这个代码中怎么添加背景图片

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;



public class MainMenu implements ActionListener
{
   
    JFrame  frame;
    JMenuItem   add,update,select,delete,exit;
    JMenu   option,cancel;
    JMenuBar  bar;
     
    MainMenu()
    {
      frame=new JFrame("欢迎登录学生信息系统 ");
      frame.setVisible(true);
      frame.setLocation(300,200);
      frame.setSize(400,300);
      frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      
      add=new JMenuItem("录入学生基本信息");
      update=new JMenuItem("修改学生基本信息");
      select=new JMenuItem("查询学生基本信息");
      delete=new JMenuItem("删除学生基本信息");
      exit=new JMenuItem("退出系统");
      
      add.addActionListener(this);
      update.addActionListener(this);
      select.addActionListener(this);
      delete.addActionListener(this);
      exit.addActionListener(this);
      
      
      
      JMenu  option=new JMenu("选择");
      JMenu  cancel=new JMenu("退出");
      
      option.add(add);
      option.add(update);
      option.add(select);
      option.add(delete);
      
      cancel.add(exit);
      
      JMenuBar  bar=new JMenuBar();
      bar.add(option);
      bar.add(cancel);
      
      frame.setJMenuBar(bar);
    }
    public void actionPerformed(ActionEvent e)
    {
        if(e.getSource()==add)
        {   
            new  AddWindow();
            frame.setVisible(false);
        }
        
        if(e.getSource()==delete)
        {   
            new  DeleteWindow();
            frame.setVisible(false);
        }
        
        if(e.getSource()==exit)
        {
            System.exit(0);
        }
    }
 
        public static void main(String args[])
        {
            new MainMenu();
        }
 }
   

搜索更多相关主题的帖子: 信息 系统 背景图片 public frame 
2012-12-21 19:06
快速回复:求助 在这个代码中怎么添加背景图片
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016805 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved