十年網站開發(fā)經驗 + 多家企業(yè)客戶 + 靠譜的建站團隊
量身定制 + 運營維護+專業(yè)推廣+無憂售后,網站問題一站解決
1、用netbeans編程,新建項目的時候選擇java應用程序,再在項目里新建類選擇JFrame窗體,你就可以像畫畫一樣布置界面了
成都創(chuàng)新互聯(lián)主營大城網站建設的網絡公司,主營網站建設方案,成都app開發(fā),大城h5成都小程序開發(fā)搭建,大城網站營銷推廣歡迎大城等地區(qū)企業(yè)咨詢
2、布置的時候將右面窗口控件直接拖進窗口進行布局即可
3、你可以復制控件,然后貼貼,新的控件與復制的類型一樣,所有設定都一樣,除了變量名
4、右擊屬性里可以各種設置,不必你自己去敲各種set的代碼
5、在右擊的“事件”中可以選擇各種觸發(fā)事件,你只要一點,就自動跳到相關位置了,你在提示范圍內敲入代碼就行了
有圖有真相
JAVA現(xiàn)在咋說呢,現(xiàn)在不吃香,底層開發(fā)c和c ,網頁php、asp.net,這些都很火,再說現(xiàn)在學計算機的人很多,你不是科班出身,又沒有相關工作經驗,可能是競爭不過所以一直沒有得到認可,希望你還是先去一些小公司積攢工作經驗。另外,通過java基礎去學習其他語言,尤其是公司招聘要求中所希望你具備的技能,鍛煉表達能力,比如你做好一個項目,如何介紹給一個客戶。希望你找到稱心如意的工作。
現(xiàn)在比較常用的是eclipse和myeclipse
常用框架有:struts1,struts2,hibernate,spring,ibatis,Lucene
Struts1和2,主要處理的是視圖層和控制層,也就是頁面表單數據的處理和邏輯控制和交互等
hibernate和ibatis,都是處理實體與數據庫之間的關系映射的
spring是管理bean的!
Lucene是全文檢索的框架!
當然回答可能不是很準確和全面,詳細的自己找資料看
1.Java代碼
[java]?view plain?copy
@RequestMapping("/sq-condition/{type}")
public?ModelAndView?sqCondition(@PathVariable(value="type")?int?type){
MapString,Object?validateMap=validateSession(sessionTimeOut);
if(validateMap.get("SESSION_VALIDATED").toString().equals("false")){
return?new?ModelAndView(sessionTimeOut);
}
ModelAndView?mv=new?ModelAndView("redirect:/pda/stock/sq-condition.html");
mv.addObject("type",?type);
return?mv;
}
注:根據類型控制顯示不同條件。
2.JSP代碼
[html]?view plain?copy
%@?page?language="java"?contentType="text/html;?charset=UTF-8"
pageEncoding="UTF-8"%
%@page?import="com.wlyd.fmcgwms.util.ehcache.EhcacheUtil"%
%@page?import="com.wlyd.fmcgwms.persistence.beans.EsUser"%
%@page?import="com.wlyd.fmcgwms.util.finals.Const"%
%@?taglib?prefix="c"?uri="h/jsp/jstl/core"%
%@?page?isELIgnored="false"?%
%
String?staticUrl?=?(String)?EhcacheUtil.get("staticUrl");
String?webRoot?=?request.getContextPath();
EsUser?user?=?(EsUser)?session.getAttribute(Const.SESSION_BACK_USER);
%
!DOCTYPE?html?PUBLIC?"-//W3C//DTD?HTML?4.01?Transitional//EN"?"oose.dtd"
html
head
meta?charset="utf-8"
title智能倉庫管理系統(tǒng)/title
link?rel="stylesheet"?href="%=staticUrl%/pda/css/base.css"
link?rel="stylesheet"?href="%=staticUrl?%/pda/css/style.css"
/head
body
${requestScope.type}br/
%=request.getAttribute("type")%
c:if?test="${requestScope.type?eq?1}"
div?class="header"
庫存查詢-2
/div
ul?class="ul-table"
lispan?class="li-th"em*/em數字倉管編碼:/spandiv?class="li-td"input?type="text"/div/li
lispan?class="li-th"em*/em商品條碼:/spandiv?class="li-td"input?type="text"/div/li
/ul
/c:if
c:if?test="${requestScope.type?eq?2}"
div?class="header"
庫存查詢-4
/div
ul?class="ul-table"
lispan?class="li-th"em*/em數字倉管編碼:/spandiv?class="li-td"input?type="text"/div/li
lispan?class="li-th"em*/em貨位條碼:/spandiv?class="li-td"input?type="text"/div/li
/ul
/c:if
/body
/html
3.效果圖
如果是B/S模式的就相對來說簡單些,而且也好維護點,用JAVA可以開發(fā),
如果是C/S模式的就相對復雜點,可以用C++做,MFC會讓你省不少時間。
import java.util.*;
import java.awt.event.*;
import java.awt.*;
import javax.swing.*;
import java.io.*;
class 商品 extends Panel
{String 代號,名稱;int 庫存;float 單價; br/商品(String 代號,String 名稱,int 庫存,float 單價) br/{this.代號=代號;this.名稱=名稱;this.庫存=庫存;this.單價=單價; br/}
}
class ShowWin extends JFrame implements ActionListener
{ Hashtable hashtable=null;
JTextField 代號文本框=new JTextField(),
名稱文本框=new JTextField(),
庫存文本框=new JTextField(),
單價文本框=new JTextField(),
查詢文本框=new JTextField(),
查詢信息文本框=new JTextField(),
刪除文本框=new JTextField();
JButton b_add=new JButton("添加商品"),
b_del=new JButton("刪除商品"),
b_xun=new JButton("查詢商品"),
b_xiu=new JButton("修改商品"),
b_show=new JButton("顯示商品清單");
JTextArea 顯示區(qū)=new JTextArea(25,10);
ShowWin()
{super("倉庫管理窗口"); br/hashtable=new Hashtable(); br/Container con=getContentPane(); br/JScrollPane pane=new JScrollPane(顯示區(qū)); br/顯示區(qū).setEditable(false); br/JPanel save=new JPanel(); br/save.setLayout(new GridLayout(8,2)); br/save.add(new Label("輸入代號:")); br/save.add(代號文本框); br/save.add(new Label("輸入名稱:")); br/save.add(名稱文本框); br/save.add(new Label("輸入庫存:"));/pre /div div class="replenish min_margin" dl dt 補充: /dt dd save.add(庫存文本框); br/save.add(new Label("輸入單價:")); br/save.add(單價文本框); br/save.add(new Label("單擊添加:")); br/save.add(b_add); br/save.add(new Label("單擊修改:")); br/save.add(b_xiu); br/save.add(new Label("輸入查詢代號:")); br/save.add(查詢文本框); br/save.add(new Label("單擊查詢:")); br/save.add(b_xun); br/JPanel del=new JPanel(); br/del.setLayout(new GridLayout(2,2)); br/del.add(new Label("輸入刪除的代號:")); br/del.add(刪除文本框); br/del.add(new Label("單擊刪除:")); br/del.add(b_del); br/JPanel show=new JPanel(); br/show.setLayout(new BorderLayout()); br/show.add(pane,BorderLayout.CENTER); br/show.add(b_show,BorderLayout.SOUTH); br/JSplitPane split_one,split_two; br/split_one=new JSplitPane(JSplitPane.VERTICAL_SPLIT,save,del); br/split_two=new br/JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,split_one,show); br/con.add(split_two,BorderLayout.CENTER); br/JPanel xun=new JPanel(); br/xun.add(new Label("所得信息:")); br/xun.add(查詢信息文本框); br/xun.setLayout(new GridLayout(2,1)); br/con.add(xun,BorderLayout.SOUTH); br/b_add.addActionListener(this); /dd /dl dl dt 補充: /dt dd b_del.addActionListener(this); br/b_xun.addActionListener(this); br/b_xiu.addActionListener(this); br/b_show.addActionListener(this); br/}
public void actionPerformed(ActionEvent e)
{if(e.getSource()==b_add) br/{String daihao=null,mingcheng=null;int kucun=0;float danjia=0.0f; br/daihao=代號文本框.getText();mingcheng=名稱文本框.getText(); br/kucun=Integer.parseInt(庫存文本框.getText()); br/danjia=Float.valueOf(單價文本框.getText()).floatValue(); br/商品 goods=new 商品(daihao,mingcheng,kucun,danjia); br/hashtable.put(daihao,goods); br/try{FileOutputStream file=new FileOutputStream("goods.txt"); br/ObjectOutputStream out=new ObjectOutputStream(file); br/out.writeObject(hashtable); out.close(); br/}
catch(IOException event){}
}
else if(e.getSource()==b_del)
{String daihao1=刪除文本框.getText(); br/try{FileInputStream come_in=new FileInputStream("goods.txt"); br/ObjectInputStream in=new ObjectInputStream(come_in); br/hashtable=(Hashtable)in.readObject(); ////// br/in.close(); br/} /dd /dl 補充: catch(ClassNotFoundException event){}
catch(IOException event){}
商品 temp=(商品)hashtable.get(daihao1);
{hashtable.remove(daihao1);}
try{FileOutputStream file=new FileOutputStream("goods.txt"); br/ObjectOutputStream out =new ObjectOutputStream(file); br/out.writeObject(hashtable);// br/out.close(); br/}
catch(IOException event){}
}
//
else if(e.getSource()==b_xun)
{ String aa;
aa=查詢文本框.getText();
查詢信息文本框.setText(null);
try{FileInputStream come_in=new FileInputStream("goods.txt"); br/ObjectInputStream in =new ObjectInputStream(come_in); br/hashtable=(Hashtable)in.readObject(); //// br/in.close(); br/}
catch(ClassNotFoundException event){}
catch(IOException event){}
商品 a=(商品)hashtable.get(aa);
查詢信息文本框.setText(" 代號:"+a.代號+" 名稱:"+a.名稱+" 庫存:"+a.庫存+" 單價:"+a.單價);
}
//
else if(e.getSource()==b_xiu)
{ String bb;
bb=代號文本框.getText();
try{FileInputStream come_in=new FileInputStream("goods.txt"); br/ObjectInputStream in=new ObjectInputStream(come_in); /dd /dl dl dt 補充: /dt dd hashtable=(Hashtable)in.readObject(); ////// br/in.close(); br/}
catch(ClassNotFoundException event){}
catch(IOException event){}
商品 temp=(商品)hashtable.get(bb);
{hashtable.remove(bb);}
try{FileOutputStream file=new FileOutputStream("goods.txt"); br/ObjectOutputStream out =new ObjectOutputStream(file); br/out.writeObject(hashtable);// br/out.close(); br/}
catch(IOException event){}
String daihao1=null,mingcheng1=null;int kucun1=0;float danjia1=0.0f;
daihao1=代號文本框.getText();mingcheng1=名稱文本框.getText();
kucun1=Integer.parseInt(庫存文本框.getText());
danjia1=Float.valueOf(單價文本框.getText()).floatValue();
商品 goods1=new 商品(daihao1,mingcheng1,kucun1,danjia1);
hashtable.put(daihao1,goods1);
try{FileOutputStream file=new FileOutputStream("goods.txt"); br/ObjectOutputStream out=new ObjectOutputStream(file); br/out.writeObject(hashtable); out.close(); br/}
catch(IOException event){}
}
//
else if(e.getSource()==b_show)
{ 顯示區(qū).setText(null); 補充: try{FileInputStream come_in=new FileInputStream("goods.txt"); br/ObjectInputStream in =new ObjectInputStream(come_in); br/hashtable=(Hashtable)in.readObject(); //// br/}
catch(ClassNotFoundException event){}
catch(IOException event){}
Enumeration enum=hashtable.elements();
while(enum.hasMoreElements())
{ 商品 te=(商品)enum.nextElement();
顯示區(qū).append("商品代號:"+te.代號+" ");
顯示區(qū).append("商品名稱:"+te.名稱+" ");
顯示區(qū).append("商品庫存:"+te.庫存+" ");
顯示區(qū).append("商品單價:"+te.單價+" ");
顯示區(qū).append("\n ");
}
}
}
}
public class LinkListFour
{public static void main(String args[]) br/{ ShowWin win=new ShowWin(); br/win.setSize(400,350); br/win.setVisible(true); br/win.addWindowListener(new WindowAdapter() br/{public void windowClosing(WindowEvent e) br/{ System.exit(0);}});
}
}
終于完了! 追問: 這里面應該沒有涉及到功能吧?? 回答: 你可以根據這個寫出來呀!呵呵.