前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >文件切割合并器  1 主类  SplitAnd…

文件切割合并器  1 主类  SplitAnd…

作者头像
明明如月学长
发布2021-08-27 11:05:08
3760
发布2021-08-27 11:05:08
举报
文章被收录于专栏:明明如月的技术专栏

import java.awt.BorderLayout;

import java.awt.GridBagLayout;

import java.awt.event.ActionEvent;

import java.awt.event.ActionListener;

import java.util.Locale;

import java.util.MissingResourceException ;

import java.util.ResourceBundle;

import javax.swing.ImageIcon;

import javax.swing.JButton;

import javax.swing.JFrame;

import javax.swing.JPanel;

public class SplitAndMergemain extends InitFrame{

private static final long serialVersionUID = 1L;

public SplitAndMergemain()

{

super("文件切割合并器","file_split.png",420,220);

this.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);

init();

this.setVisible(true);

}

private void init()

{

this.setLayout(new BorderLayout());

// 初始化面板

centerPanel = new JPanel();

// 设置面板布局

centerPanel.setLayout(new GridBagLayout());

this.add(centerPanel,BorderLayout.CENTER);

this.setResizable(false);

button_split = new JButton("   文   件   切   割",new ImageIcon(SplitAndMergemain.class.getResource("/resources/split_编辑.png")));

button_split.addActionListener(listener);

button_merge = new JButton("   文   件   合   并",new ImageIcon(SplitAndMergemain.class.getResource("/resources/merge_编辑.png")));

button_merge.addActionListener(listener);

button_help = new JButton("帮   助",new ImageIcon(SplitAndMergemain.class.getResource("/resources/help.png")));

button_help.addActionListener(listener);

button_about = new JButton("关   于",new ImageIcon(SplitAndMergemain.class.getResource("/resources/about.png")));

button_about.addActionListener(listener);

centerPanel.add(button_split,new GBC(0,0,3,2));

centerPanel.add(button_merge,new GBC(0,2,3,2));

centerPanel.add(button_help,new GBC(0,5,1,1));

centerPanel.add(button_about,new GBC(2,5,1,1));

}

private class ChoiceListener implements ActionListener

{

public void actionPerformed(ActionEvent e) 

{

if(e.getSource()==button_split)

{

new Split();

}else if(e.getSource()==button_merge)

{

new Merge();

}else if(e.getSource()==button_help)

{

new Help();

}else if(e.getSource()==(button_about))

{

new About();

}

}

}

public static void main(String[] args) 

{

new SplitAndMergemain();

}

ChoiceListener listener = new ChoiceListener();

private JPanel   centerPanel;

private JButton button_split ;

private JButton button_merge;

private JButton button_help;

private JButton button_about;

}

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2015/06/20 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档