樓上說(shuō)的對(duì)啊,時(shí)間問(wèn)題,祝你好運(yùn)啦!
公司主營(yíng)業(yè)務(wù):成都網(wǎng)站制作、成都網(wǎng)站建設(shè)、移動(dòng)網(wǎng)站開(kāi)發(fā)等業(yè)務(wù)。幫助企業(yè)客戶真正實(shí)現(xiàn)互聯(lián)網(wǎng)宣傳,提高企業(yè)的競(jìng)爭(zhēng)能力。創(chuàng)新互聯(lián)是一支青春激揚(yáng)、勤奮敬業(yè)、活力青春激揚(yáng)、勤奮敬業(yè)、活力澎湃、和諧高效的團(tuán)隊(duì)。公司秉承以“開(kāi)放、自由、嚴(yán)謹(jǐn)、自律”為核心的企業(yè)文化,感謝他們對(duì)我們的高要求,感謝他們從不同領(lǐng)域給我們帶來(lái)的挑戰(zhàn),讓我們激情的團(tuán)隊(duì)有機(jī)會(huì)用頭腦與智慧不斷的給客戶帶來(lái)驚喜。創(chuàng)新互聯(lián)推出華池免費(fèi)做網(wǎng)站回饋大家。
PS:樓主不是我說(shuō)你,這事早干嘛了~~
這種東西已涉及到商業(yè)利益,沒(méi)人愿意幫你吧!都想你這樣別人都沒(méi)錢(qián)賺啦
package?javaapplication26;
import?java.awt.*;
import?java.awt.event.*;
import?javax.swing.*;
//?Import?the?Java?classes
import?java.util.*;
import?javax.swing.border.EmptyBorder;
/**
*?A?JOutlookBar?provides?a?component?that?is?similar?to?a?JTabbedPane,?but?instead?of?maintaining
*?tabs,?it?uses?Outlook-style?bars?to?control?the?visible?component
*/
public?class?JOutlookBar?extends?JPanel?implements?ActionListener?{
private?JPanel?topPanel?=?new?JPanel(new?GridLayout(1,?1));
private?JPanel?bottomPanel?=?new?JPanel(new?GridLayout(1,?1));
/**
*?A?LinkedHashMap?of?bars:?we?use?a?linked?hash?map?to?preserve?the?order?of?the?bars
*/
private?Map?bars?=?new?LinkedHashMap();
/**
*?The?currently?visible?bar?(zero-based?index)
*/
private?int?visibleBar?=?0;
/**
*?A?place-holder?for?the?currently?visible?component
*/
private?JComponent?visibleComponent?=?null;
/**
*?Creates?a?new?JOutlookBar;?after?which?you?should?make?repeated?calls?to
*?addBar()?for?each?bar
*/
public?JOutlookBar()?{
this.setLayout(new?BorderLayout());
this.add(topPanel,?BorderLayout.NORTH);
this.add(bottomPanel,?BorderLayout.SOUTH);
}
public?void?addBar(String?name,?JComponent?component)?{
BarInfo?barInfo?=?new?BarInfo(name,?component);
barInfo.getButton().addActionListener(this);
this.bars.put(name,?barInfo);
render();
}
/**
*?Adds?the?specified?component?to?the?JOutlookBar?and?sets?the?bar's?name
*
*?@param??name??????The?name?of?the?outlook?bar
*?@param??icon??????An?icon?to?display?in?the?outlook?bar
*?@param??componenet???The?component?to?add?to?the?bar
*/
public?void?addBar(String?name,?Icon?icon,?JComponent?component)?{
BarInfo?barInfo?=?new?BarInfo(name,?icon,?component);
barInfo.getButton().addActionListener(this);
this.bars.put(name,?barInfo);
render();
}
/**
*?Removes?the?specified?bar?from?the?JOutlookBar
*
*?@param??name??The?name?of?the?bar?to?remove
*/
public?void?removeBar(String?name)?{
this.bars.remove(name);
render();
}
/**
*?Returns?the?index?of?the?currently?visible?bar?(zero-based)
*
*?@return?The?index?of?the?currently?visible?bar
*/
public?int?getVisibleBar()?{
return?this.visibleBar;
}
/**
*?Programmatically?sets?the?currently?visible?bar;?the?visible?bar
*?index?must?be?in?the?range?of?0?to?size()?-?1
*
*?@param??visibleBar???The?zero-based?index?of?the?component?to?make?visible
*/
public?void?setVisibleBar(int?visibleBar)?{
if?(visibleBar??0?
visibleBar??this.bars.size()?-?1)?{
this.visibleBar?=?visibleBar;
render();
}
}
/**
*?Causes?the?outlook?bar?component?to?rebuild?itself;?this?means?that
*?it?rebuilds?the?top?and?bottom?panels?of?bars?as?well?as?making?the
*?currently?selected?bar's?panel?visible
*/
public?void?render()?{
//?Compute?how?many?bars?we?are?going?to?have?where
int?totalBars?=?this.bars.size();
int?topBars?=?this.visibleBar?+?1;
int?bottomBars?=?totalBars?-?topBars;
//?Get?an?iterator?to?walk?through?out?bars?with
Iterator?itr?=?this.bars.keySet().iterator();
//?Render?the?top?bars:?remove?all?components,?reset?the?GridLayout?to
//?hold?to?correct?number?of?bars,?add?the?bars,?and?"validate"?it?to
//?cause?it?to?re-layout?its?components
this.topPanel.removeAll();
GridLayout?topLayout?=?(GridLayout)?this.topPanel.getLayout();
topLayout.setRows(topBars);
BarInfo?barInfo?=?null;
for?(int?i?=?0;?i??topBars;?i++)?{
String?barName?=?(String)?itr.next();
barInfo?=?(BarInfo)?this.bars.get(barName);
this.topPanel.add(barInfo.getButton());
}
this.topPanel.validate();
//?Render?the?center?component:?remove?the?current?component?(if?there
//?is?one)?and?then?put?the?visible?component?in?the?center?of?this?panel
if?(this.visibleComponent?!=?null)?{
this.remove(this.visibleComponent);
}
this.visibleComponent?=?barInfo.getComponent();
this.add(visibleComponent,?BorderLayout.CENTER);
//?Render?the?bottom?bars:?remove?all?components,?reset?the?GridLayout?to
//?hold?to?correct?number?of?bars,?add?the?bars,?and?"validate"?it?to
//?cause?it?to?re-layout?its?components
this.bottomPanel.removeAll();
GridLayout?bottomLayout?=?(GridLayout)?this.bottomPanel.getLayout();
bottomLayout.setRows(bottomBars);
for?(int?i?=?0;?i??bottomBars;?i++)?{
String?barName?=?(String)?itr.next();
barInfo?=?(BarInfo)?this.bars.get(barName);
this.bottomPanel.add(barInfo.getButton());
}
this.bottomPanel.validate();
this.validate();
}
/**
*?Invoked?when?one?of?our?bars?is?selected
*/
public?void?actionPerformed(ActionEvent?e)?{
/*??int?currentBar?=?0;
for?(Iterator?i?=?this.bars.keySet().iterator();?i.hasNext();)?{
String?barName?=?(String)?i.next();
BarInfo?barInfo?=?(BarInfo)?this.bars.get(barName);
if?(barInfo.getButton()?==?e.getSource())?{
//?Found?the?selected?button
this.visibleBar?=?currentBar;
render();
return;
}
currentBar++;
}*/
BarInfo?barInfo?=?(BarInfo)?this.bars.get("員工管理");
if?(barInfo.getButton()?==?e.getSource())?{
this.visibleBar?=?0;
render();
return;
}
}
/**
*?Debug,?dummy?method
*/
public?static?JPanel?getDummyPanel(String?name)?{
JPanel?panel?=?new?JPanel(new?BorderLayout());
panel.add(new?JLabel(name,?JLabel.CENTER));
return?panel;
}
public?static?JPanel?getEmployeePanel()?{
GridBagLayout?gbl?=?new?GridBagLayout();
GridBagConstraints?gbc?=?new?GridBagConstraints();
JPanel?panel?=?new?JPanel(gbl);
panel.setBorder(new?EmptyBorder(12,?12,?0,?11));
gbc.gridx?=?0;
gbc.gridy?=?0;
gbc.insets?=?new?Insets(0,?0,?0,?5);
gbc.anchor?=?GridBagConstraints.EAST;
panel.add(new?JMenuItem(new?addEmployeeInfoAction()),?gbc);
gbc.gridy++;
gbc.insets?=?new?Insets(0,?0,?0,?5);
gbc.anchor?=?GridBagConstraints.EAST;
panel.add(new?JMenuItem(new?modifyEmployeeInfoAction()),?gbc);
gbc.gridy++;
gbc.insets?=?new?Insets(0,?0,?0,?5);
gbc.anchor?=?GridBagConstraints.EAST;
panel.add(new?JMenuItem(new?searchEmployeeInfoAction()),?gbc);
gbc.gridy++;
gbc.insets?=?new?Insets(0,?0,?0,?5);
gbc.anchor?=?GridBagConstraints.EAST;
panel.add(new?JMenuItem(new?deleteEmployeeInfoAction()),?gbc);
return?panel;
}
/**
*?Debug?test...
*/
public?static?void?main(String[]?args)?{
JFrame?frame?=?new?JFrame("學(xué)生信息管理");
JOutlookBar?outlookBar?=?new?JOutlookBar();
//outlookBar.addBar(TOOL_TIP_TEXT_KEY,?component)
outlookBar.addBar("員工管理",?getEmployeePanel());
//?outlookBar.add
outlookBar.addBar("飯卡管理",?getDummyPanel(""));
outlookBar.addBar("銷(xiāo)售管理",?getDummyPanel(""));
//??outlookBar.addBar(?"Four",?getDummyPanel(?"Four"?)?);
//???outlookBar.addBar(?"Five",?getDummyPanel(?"Five"?)?);
outlookBar.setVisibleBar(2);
frame.getContentPane().add(outlookBar);
frame.setSize(200,?400);
Dimension?d?=?Toolkit.getDefaultToolkit().getScreenSize();
frame.setLocation(d.width?/?2?-?400,?d.height?/?2?-?300);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
/**
*?Internal?class?that?maintains?information?about?individual?Outlook?bars;
*?specifically?it?maintains?the?following?information:
*
*?name??????The?name?of?the?bar
*?button?????The?associated?JButton?for?the?bar
*?component????The?component?maintained?in?the?Outlook?bar
*/
class?BarInfo?{
/**
*?The?name?of?this?bar
*/
private?String?name;
/**
*?The?JButton?that?implements?the?Outlook?bar?itself
*/
private?JButton?button;
/**
*?The?component?that?is?the?body?of?the?Outlook?bar
*/
private?JComponent?component;
/**
*?Creates?a?new?BarInfo
*
*?@param??name????The?name?of?the?bar
*?@param??component??The?component?that?is?the?body?of?the?Outlook?Bar
*/
public?BarInfo(String?name,?JComponent?component)?{
this.name?=?name;
this.component?=?component;
this.button?=?new?JButton(name);
}
/**
*?Creates?a?new?BarInfo
*
*?@param??name????The?name?of?the?bar
*?@param??icon????JButton?icon
*?@param??component??The?component?that?is?the?body?of?the?Outlook?Bar
*/
public?BarInfo(String?name,?Icon?icon,?JComponent?component)?{
this.name?=?name;
this.component?=?component;
this.button?=?new?JButton(name,?icon);
}
public?String?getName()?{
return?this.name;
}
/**
*?Sets?the?name?of?the?bar
*
*?@param??The?name?of?the?bar
*/
public?void?setName(String?name)?{
this.name?=?name;
}
public?JButton?getButton()?{
return?this.button;
}
public?JComponent?getComponent()?{
return?this.component;
}
}
}
class?addEmployeeInfoAction?extends?AbstractAction?{
{
putValue(Action.SHORT_DESCRIPTION,?"heool");
putValue(Action.NAME,?"添加員工信息");
putValue(Action.LONG_DESCRIPTION,?"Name?this?element.");
putValue(Action.MNEMONIC_KEY,
new?Integer(java.awt.event.KeyEvent.VK_L));
}
public?void?actionPerformed(ActionEvent?e)?{
JDialog?dialog?=?new?JDialog();
dialog.setName("Message");
dialog.setVisible(true);
//throw?new?UnsupportedOperationException("Not?supported?yet.");
}
}
class?modifyEmployeeInfoAction?extends?AbstractAction?{
{
putValue(Action.SHORT_DESCRIPTION,?"heool");
putValue(Action.NAME,?"修改員工信息");
putValue(Action.LONG_DESCRIPTION,?"Name?this?element.");
putValue(Action.MNEMONIC_KEY,
new?Integer(java.awt.event.KeyEvent.VK_L));
}
public?void?actionPerformed(ActionEvent?e)?{
JDialog?dialog?=?new?JDialog();
dialog.setName("Message");
dialog.setVisible(true);dialog.setSize(100,?100);
//throw?new?UnsupportedOperationException("Not?supported?yet.");
}
}
class?searchEmployeeInfoAction?extends?AbstractAction?{
{
putValue(Action.SHORT_DESCRIPTION,?"heool");
putValue(Action.NAME,?"查詢員工信息");
putValue(Action.LONG_DESCRIPTION,?"Name?this?element.");
putValue(Action.MNEMONIC_KEY,
new?Integer(java.awt.event.KeyEvent.VK_L));
}
public?void?actionPerformed(ActionEvent?e)?{
JDialog?dialog?=?new?JDialog();
dialog.setName("Message");
dialog.setVisible(true);
//throw?new?UnsupportedOperationException("Not?supported?yet.");
}
}
class?deleteEmployeeInfoAction?extends?AbstractAction?{
{
putValue(Action.SHORT_DESCRIPTION,?"heool");
putValue(Action.NAME,?"刪除員工信息");
putValue(Action.LONG_DESCRIPTION,?"Name?this?element.");
putValue(Action.MNEMONIC_KEY,
new?Integer(java.awt.event.KeyEvent.VK_L));
}
public?void?actionPerformed(ActionEvent?e)?{
JDialog?dialog?=?new?JDialog();
dialog.setName("Message");
dialog.setVisible(true);dialog.setVisible(true);
//點(diǎn)擊對(duì)應(yīng)的操作
//throw?new?UnsupportedOperationException("Not?supported?yet.");
}
}
程序沿用到樓上的那個(gè)模板,不過(guò)有些地方很毛糙,你自己在修改一下,比方說(shuō)對(duì)事件的定義還有對(duì)那幾個(gè)選項(xiàng)的位置等你自己再修改一下
答案voidmain(){intsele=1,t;floatx;system("cls");printf("歡迎使用簡(jiǎn)易菜單!本菜單在VC++平臺(tái)編譯通過(guò)\n");printf("有何建議請(qǐng)聯(lián)系本人!\n");printf("成績(jī)管理菜單\n");printf("\n");printf("1.輸入成績(jī)2.計(jì)算總分3.求平均值4.輸出總分與平均5.清理屏幕6.高低排列7.上平均分人數(shù)0.退出8.全部情況:總分平均分第一名及格人數(shù)");scanf("%d",sele);puts("");if(sele=0sele1.輸入成績(jī)2.計(jì)算總分3.求平均值4.輸出總分與平均5.清理屏幕6.高低排列7.上平均分人數(shù)0.退出8.全部情況:總分平均分第一名及格人數(shù)\n");break;case6:gaodi(a);break;case7:super(a);break;case8:full(t,x);break;}elseprintf("你的輸入有誤,請(qǐng)重新:")
本文名稱(chēng):飯卡java代碼 飯卡系統(tǒng)
URL網(wǎng)址:http://muchs.cn/article32/doegdsc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)頁(yè)設(shè)計(jì)公司、網(wǎng)站設(shè)計(jì)公司、建站公司、定制網(wǎng)站、外貿(mào)建站、定制開(kāi)發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)