1.JAVAå
è´¹ï¼
2.java小程序源代码,源码简单点的免费源码之家怎么运行,100多行,源码仿掌上飞车源码谁有啊
JAVAå è´¹ï¼
javaå è´¹ä¹
å¼å§æ¶è´¹ï¼ä»¥åæ¶è´¹ã
ä»ç½ä¸ä¸è½½ä¸æ¥çjava软件æ¯å è´¹çï¼å¨ä½¿ç¨è¿ç¨ä¸ï¼æçæ¯éè¦æ¶è´¹çï¼å½ç¶ä¹æå¾å¤æ¯å è´¹çï¼å¦ææ¯æå¼åå·¥å ·ï¼åºæ¬ä¸é½æ¯å è´¹çã
1ãjavaè¯è¨çæ´æ°è¿æ¯å¾å¿«çï¼ç°å¨å·²ç»æ¯javaäºï¼å¬è¯´javaå·²ç»å¨è·¯ä¸äºï¼ä¹åå°±æå¬è¯´javaè¦å¼å§æ¶è´¹äºï¼å¦æjavaççæ¶è´¹çäºï¼é£ä¹javaç¨åºååºè¯¥æä¹åå¢ï¼å ¶å®ä¹å¯ä»¥è¶æºçä¸ä¸å ¼å®¹çæ°è¯è¨ï¼ææ¯èèæ¿æ¢è ï¼å¦æé½ä¸æ³çè¯ï¼é£åªè½ä¹ä¹ç交é±å½
2ãæè°çæ¶è´¹ï¼å ¶å®æ¯Oracleä¸ç´ä»¥æ¥çæ¿çåæ¯å¦æ¤ï¼æè°æ¶è´¹æ¯é¢åå°è¾¾çå½å¨æé¶æ®µçJavaçæ¬ï¼å³æ¯ä¸ªOracleJDKçæ¬çå è´¹Bugä¿®å¤åå®å ¨ç»´æ¤æ¯ææéçï¼å°æåä¸å为大ä¼æä¾å¼æ¾ç»´æ¤ãå¦é继ç»ç»´æ¤ï¼åè¦ä»è´¹è·åæ´æ°æè ææ¯æ¯æã
3ãæ¶è´¹ï¼æçæ¯ä¼ä¸ç¨æ·å¦æè¦ç»§ç»ä½¿ç¨å¹´1æ以ååå¸çJavaæ´æ°ï¼éè¦ä»è´¹è´ä¹°Oracleçåä¸è®¸å¯è¯ã
javaeeæ¯å è´¹çå
javaeeæ¯å è´¹çå
javaçå¼åå¹³å°æ¯å è´¹ï¼ä½æ¯ç¨javaå¼ååºæ¥çç¨åºæ¯å¦å è´¹åå³äºè¿ä¸ªå¼åå¢éæå ¬å¸ï¼åä½ æ说çè¿ç§æ åµï¼æ¯ä½ ææºéçè¿ä¸ªå¼ååç¨javaè¿ä¸ªè¯è¨å¼åäºä¸ä¸ªç¨åºä¾ä½ 使ç¨ï¼ä½æ¯ååäºæäºä¸å°éçæç®±æä½ï¼å¯¼è´ä½ å¨æ²¡æå¾å°è¦ç¤ºéç¥çæ åµä¸è¢«çµä¿¡æ移å¨ä¸å¡è¿è¥åæ£è´¹äºã
ææJavaå¹è®ï¼å è´¹javaå¼åå·¥å ·æåªäº?免费wpe云封包源码å®ç¨åjavaå¼åå·¥å ·ç¹ç¹?使ç¨å¼åå·¥å ·ä¹åï¼éè¦ç¥éå è´¹javaå¼åå·¥å ·æåªäº?å®ç¨åjavaå¼åå·¥å ·ç¹ç¹ï¼æ们以çç¥è¿äºè½¯ä»¶çä¼ç¹å缺ç¹ä¸ºåæï¼ä»¥ä¾¿å¨åæå®æè¿ç¨ä¸æ ¹æ®å®é æ åµéæ©åºç¨æéåççjavaå¼åå·¥å ·ã
å è´¹javaå¼åå·¥å ·æåªäº?å®ç¨åjavaå¼åå·¥å ·ç¹ç¹?javaå¼åå·¥å ·ä¸ãJavaWorkshopSunMicroSystemså ¬å¸äºæ¨åºäºJavaWorkShop1.0ï¼è¿æ¯ä¸çåºç°ç第ä¸ä¸ªä¾Internetç½ä½¿ç¨çå¤å¹³å°å¼åå·¥å ·ï¼å®å¯ä»¥æ»¡è¶³åå ¬å¸å¼åInternetåIntranetç½åºç¨è½¯ä»¶çéè¦ã
JavaWorkShopå®å ¨ç¨Javaè¯è¨ç¼åï¼æ¯å½ä»å¸åºä¸éå®ç第ä¸ä¸ªå®å ¨çJavaå¼åç¯å¢ï¼ç®åJavaWorkShopçææ§çæ¬æ¯3.0ã
JavaWorkshopçç¹ç¹è¡¨ç°å¦ä¸ï¼1)ç»ææäºå建ï¼å¨å建平å°ä¸ç«çç½æ ¼ç»ææ¹é¢ï¼JavaWorkshopæ¯å ¶ä»ä»»ä½ä¸ç§Javaå¼åå·¥å ·é½è¦æ¹ä¾¿ã
2)å¯è§åç¼ç¨ï¼JavaWorkshopçå¯è§åç¼ç¨ç¹æ§æ¯å¾åºæ¬çã
JavaWorkshopå 许ç¨åºåéæ°å®æè¿äºæä½ï¼çè³å¯ä»¥ç¡®å®è§¦åæä½è¡ä¸ºçè¿æ»¤å¨ã
JavaWorkshop产çç模æ¿å¸¦æ许å¤æ³¨éï¼è¿å¯¹ç¨åºåæ¯å¾æ帮å©çã
æ¤å¤ï¼JavaWorkShopæ¯æJDK以åJavaBeansç»ä»¶æ¨¡åï¼APIåè¯è¨ç¹å¾å¢å äºç¼è¯Javaåºç¨ç¨åºççµæ´»æ§ã
JavaWorkShopå¼åç¯å¢ç±äºå®å ¨ç¨Javaåæï¼æ以å¯ç§»æ¤æ§æ好,以è´äºå¤ä¸ªå¹³å°é½è½æ¯æ,ç®åJavaWorkShopæ¯æSolarisæä½ç¯å¢SPARCåIntelç)ãWindowsãWindowsNTã以åHP/Uxçå¹³å°ã
éåäºåå¦è è¿è¡ä¸äºç®åçJavaç¼ç¨ã
JavaWorkShopç缺ç¹æ¯JavaWorkshopä¸çæ¯ä¸ä¸ªå¯è§å对象é½è¿æ©ä¼ç¨å°ç½æ ¼å¸å±ï¼è¿ç§è®¾è®¡æ¹æ³æ¯è®¸å¤äººä¸ä¹ æ¯ç;JavaWorkdshopçè°è²æ¿æ¯è¾å·®çï¼ä» ä» è½æ»¡è¶³ç»å¤§é¨ååºç¨çåºæ¬è¦æ±ã
javaå¼åå·¥å ·äºãBorlandçJBuilderJbuilderè¿å ¥äºJavaéæå¼åç¯å¢ççå½ï¼å®æ»¡è¶³å¾å¤æ¹é¢çåºç¨ï¼å°¤å ¶æ¯å¯¹äºæå¡å¨æ¹ä»¥åEJBå¼åè 们æ¥è¯´ã
ä¸é¢ç®åä»ç»ä¸ä¸Jbuilderçç¹ç¹:1)Jbuilderæ¯æææ°çJavaææ¯ï¼å æ¬AppletsãJSP/ServletsãJavaBean以åEJB(EnterpriseJavaBeans)çåºç¨ã
2)ç¨æ·å¯ä»¥èªå¨å°çæåºäºå端æ°æ®åºè¡¨çEJBJavaç±»ï¼Jbuilderåæ¶è¿ç®åäºEJBçèªå¨é¨ç½²åè½.æ¤å¤å®è¿æ¯æCORBAï¼ç¸åºçå导ç¨åºæå©äºç¨æ·å ¨é¢å°ç®¡çIDL(åå¸åºç¨ç¨åºæå¿ éçæ¥å£å®ä¹è¯è¨InterfaceDefinitionLanguage)åæ§å¶è¿ç¨å¯¹è±¡ã
3)Jbuilderæ¯æåç§åºç¨æå¡å¨ã
Jbuilderä¸InpriseApplicationServerç´§å¯éæï¼åæ¶æ¯æWebLogicServerï¼æ¯æEJB1.1åEJB2.0ï¼å¯ä»¥å¿«éå¼åJ2EEççµååå¡åºç¨ã
4)Jbuilderè½ç¨ServletåJSPå¼ååè°è¯å¨æWebåºç¨ã
5)å©ç¨Jbuilderå¯å建(没æä¸æ代ç åæ è®°)纯Java2åºç¨ã
ç±äºJbuilderæ¯ç¨çº¯Javaè¯è¨ç¼åçï¼å ¶ä»£ç ä¸å«ä»»ä½ä¸å±ä»£ç åæ è®°ï¼å®æ¯æææ°çJavaæ åã
6)Jbuilderæ¥æä¸ä¸åçå¾å½¢è°è¯ä»é¢ï¼æ¯æè¿ç¨è°è¯åå¤çº¿ç¨è°è¯ï¼è°è¯å¨æ¯æåç§JDKçæ¬,å æ¬J2ME/J2SE/J2EEã
JBuilderç¯å¢å¼åç¨åºæ¹ä¾¿ï¼å®æ¯çº¯çJavaå¼åç¯å¢ï¼éåä¼ä¸çJ2EEå¼å;缺ç¹æ¯å¾å¾ä¸å¼å§äººä»¬é¾äºææ¡æ´ä¸ªç¨åºåé¨åä¹é´çå ³ç³»ï¼å¯¹æºå¨ç硬件è¦æ±è¾é«ï¼æ¯è¾åå åï¼è¿æ¶è¿è¡é度æ¾å¾è¾æ ¢ã
javaå¼åå·¥å ·ä¸ãIBMçVisualAgeforJavaVisualAgeforJavaæ¯ä¸ä¸ªé常æççå¼åå·¥å ·ï¼å®çç¹æ§ä»¥äºITå¼åè åä¸ä½çJavaç¼ç¨äººåæ¥è¯´é½æ¯é常ç¨æç¨çã
å®æä¾å¯¹å¯è§åç¼ç¨ç广æ³æ¯æï¼æ¯æå©ç¨CICSè¿æ¥éä¼ å¤§åæºåºç¨ï¼æ¯æEJBçå¼ååºç¨ï¼æ¯æä¸Websphereçéæå¼åï¼æ¹ä¾¿çbeanå建åè¯å¥½çå¿«éåºç¨å¼å(RAD)æ¯æåæ æ件å¼çæ件å¤çã
IBM为建设Webç«ç¹ææ¨åºçWebSphereStudioAdvancedEditionåå ¶å å«çVisualAgeforJavaProfessionalEditionè½¯ä»¶å·²å ¨é¢è½¬å以Java为ä¸å¿ï¼è¿æ ·ï¼Javaå¼å人å对WebSphereå ¨å¥å·¥å ·çæè§æ许ä¼å¥½äºè®¸å¤ã
Studioææä¾çå·¥å ·æï¼Webç«ç¹ç®¡çãå¿«éå¼åJDBC页å导ç¨åºãHTMLç¼è¾å¨åHTMLè¯æ³æ£æ¥çã
è¿ç¡®å®æ¯ä¸ªä¸éçHTMLç«ç¹é¡µé¢ç¼è¾ç¯å¢ã
StudioåVisualAgeéæ度å¾é«ï¼èåä¸æä¾äºå¨ä¸¤ç§è½¯ä»¶å ä¹é´å¿«é移å¨ä»£ç çé项ã
è¿å°±è®©ä½¿ç¨StudioçWeb页é¢è®¾è®¡äººåå使ç¨VisualAgeçJavaç¨åºåå¯ä»¥ç¸äºäº¤æ¢æ件ãååå·¥ä½ã
VisualAgeforJavaæ¯æå¢éå¼åï¼å ç½®ç代ç åºå¯ä»¥èªå¨å°æ ¹æ®ç¨æ·ååºæ¹å¨èä¿®æ¹ç¨åºä»£ç ï¼è¿æ ·å°±å¯ä»¥å¾æ¹ä¾¿å°å°ç®å代ç åæ©æçæ¬ååºæ¯è¾ã
ä¸VisualAgeç´§å¯ç»åçWebsphereStudioæ¬èº«å¹¶ä¸æä¾æºä»£ç åçæ¬ç®¡ççæ¯æï¼å®åªæ¯å å«äºä¸ä¸ªå ç½®æ件éå®ç³»ç»,å½ç¼è¾é¡¹ç®çæ¶åå¯ä»¥é²æ¢å ¶ä»äººå¯¹è¿äºæ件çé误修æ¹ï¼è½¯ä»¶è¿æ¯æ诸å¦MicrosoftVisualSourceSafeè¿æ ·ç第ä¸æ¹æºä»£ç æ§å¶ç³»ç»ã
VisualAgeforJavaå®å ¨é¢å对象çç¨åºè®¾è®¡ææ³ä½¿å¾å¼åç¨åºé常快éãé«æã
ä½ å¯ä»¥ä¸ç¼åä»»ä½ä»£ç å°±å¯ä»¥è®¾è®¡åºä¸ä¸ªå ¸åçåºç¨ç¨åºæ¡æ¶ã
VisualAgeforJavaä½ä¸ºIBMçµååå¡è§£å³æ¹æ¡å ¶ä¸äº§åä¹ä¸ï¼å¯ä»¥æ ç¼å°ä¸å ¶ä»IBM产åï¼å¦WebSphereãDB2èå,è¿ éå®æä»è®¾è®¡ãå¼åå°é¨ç½²åºç¨çæ´ä¸ªè¿ç¨ã
VisualAgeforJavaç¬ç¹ç管çæ件æ¹å¼ä½¿å ¶éæå¤é¨å·¥å ·é常å°é¾,ä½ æ æ³è®©VisualAgeforJavaä¸å ¶ä»å·¥å ·ä¸èµ·èåå¼ååºç¨ã
javaå¼åå·¥å ·åãWebGainçVisu模æ¿ç®¡çæ¯åªè½å¨Symantecå ¬å¸çJavaèææºãNetscapeå ¬å¸çJavaèææºåMicrosoftèææºä¸å·¥ä½çè°è¯å¨ã
è¿å¯¹äºå¼åè æ¥è®²æ¯ä¸ä¸ªéè¦çç¹æ§,å 为ç¨æ·å¼åçJava代ç ä¸ç许å¤è½¯ä»¶bugå°±å¯è½ä¸ä¼å¨æç§ç¹å®çèææºä¸èµ·ä½ç¨ã
å¨ä¿®æ¹åè¿è¡ç¼è¯åºç»§ç»è¿è¡è°è¯æ¶,VisualCafeä¼èªå¨å°æ件åçï¼ä½¿ç¨VisualCafeå建çåçåºç¨å ·æ许å¤ç¹ç¹ã
é¤äºææ¾çé度æé«ä¹å¤,Symantec使类åºçäºè¿å¶æ¹å¼æ¯æ£å¸¸çJDKå°VisualCafe为ææå®çå ³ç³»èªå¨çæææ´æ°å¿ è¦çJava代ç ã
å©ç¨VisualCafeï¼ç¨æ·å¯ä»¥ä»ä¸ä¸ªæ å对象æ°æ®åºä¸éåå®æ´çJavaåºç¨ç¨åºåAppletï¼èä¸å¿ åç¼åæºä»£ç ã
VisualCafeè¿æä¾äºä¸ä¸ªæ©å çæºä»£ç å¼åå·¥å ·éã
VisualCafe综åäºJava软件çå¯è§åæºç¨åºå¼åå·¥å ·ï¼å®å 许å¼å人åå¨å¯è§åè§å¾åæºè§å¾ä¹é´è¿è¡ææå°è½¬æ¢ã
å¨å¯è§åè§å¾ä¸è¿è¡çä¿®æ¹ç«å³åæ å¨æºä»£ç ä¸ã
对æºä»£ç çæ¹åèªå¨æ´æ°å¯è§åè§å¾ã
VisualCafeå ·æ许å¤æºæ件æ¹é¢çç¹æ§ï¼å¦å ¨å±æ£ç´¢åæ¿æ¢ã
ç»å¤§å¤æ°Javaå¼åå·¥å ·çæç®çé®é¢å¨äºç®åå°æ¨ä¸ªä»ç»å¼åå·¥å ·çæ¯é¨åç»ä»¶ï¼ä½ç¨æ·å¨å¼åºç¨æ¶è¿éè¦ä¸ä¸ªé¢åä»»å¡çæåï¼å©ç¨è¿ä¸ªæåä½ å¯ä»¥ä¸å¿ ç¥éå·¥å ·æ¯ä¸é¨åçç¹å®åè½å°±å¯ä»¥å¼å§å建èªå·±çåºç¨ã
VisualCafeæä¾äºéå¸¸å ¨é¢çç¨æ·æå,å®å¯¹æå¼å§çå®è£ å°å建第ä¸ä¸ªJavaåºç¨åAppleté½æä¾äºå ¨é¢ç帮å©ï¼VisualCafeå°èªå¨çææææå ³ç³»çå¿ è¦Java代ç ã
VisualCafeå¯ä»¥å¨WindowsåWindowsNTå¹³å°ä¸è¿è¡ï¼Symantecå ¬å¸ä¸ºJavaå¼åå·¥ä½æä¾ä¸ä¸ªå¨Macintoshæä½ç³»ç»ä¸å¯ä»¥è¿è¡çRADå·¥å ·ã
VisualCafeç¼è¯å¨é度å¾å¿«ï¼å¨å½é åæ¯ææ¹é¢æ¯è¾çªåº;缺ç¹å°±æ¯å¯¹äºåå¦è æ¥è¯´ï¼è¾å¤æï¼ä¹æ¯è¾é¾ã
javaå¼åå·¥å ·äºãAntAnotherNeatTool(Ant)æ¯ä¸ç§åºäºJavaçbuildå·¥å ·ã
ç论ä¸æ¥è¯´ï¼å®æäºç±»ä¼¼äº(Unix)Cä¸çmakeï¼ä½æ²¡æmakeç缺é·ã
å 为Antçåä½è å¨å¤ç§(硬件)å¹³å°ä¸å¼å软件æ¶ï¼æ æ³å¿åè¿äºå·¥å ·çéå¶åä¸ä¾¿ã
类似äºmakeçå·¥å ·æ¬è´¨ä¸æ¯åºäºshell(è¯è¨)çï¼ä»ä»¬è®¡ç®ä¾èµå ³ç³»ï¼ç¶åæ§è¡å½ä»¤(è¿äºå½ä»¤ä¸ä½ å¨å½ä»¤è¡æ²çå½ä»¤æ²¡å¤ªå¤§åºå«)ã
è¿å°±æå³çä½ å¯ä»¥å¾å®¹æå°éè¿ä½¿ç¨OSç¹æçæç¼åæ°ç(å½ä»¤)ç¨åºæ©å±è¯¥å·¥å ·;ç¶èï¼è¿ä¹æå³çä½ å°èªå·±éå¶å¨äºç¹å®çOSï¼æç¹å®çOSç±»åä¸ï¼å¦Unixã
Antå°±ä¸åäºã
ä¸åºäºshellå½ä»¤çæ©å±æ¨¡å¼ä¸åï¼Antç¨Javaçç±»æ¥æ©å±ã
(ç¨æ·)ä¸å¿ ç¼åshellå½ä»¤ï¼é ç½®æ件æ¯åºäºXMLçï¼éè¿è°ç¨targetæ ï¼å°±å¯æ§è¡åç§taskã
æ¯ä¸ªtaskç±å®ç°äºä¸ä¸ªå®ç°äºç¹å®Taskæ¥å£ç对象æ¥è¿è¡ã
Antæ¯æä¸äºå¯étaskï¼ä¸ä¸ªå¯étaskä¸è¬éè¦é¢å¤çåºæè½å·¥ä½ã
å¯étaskä¸Antçå ç½®taskåå¼ï¼åç¬æå ã
è¿ä¸ªå¯éå å¯ä»¥ä»ä½ ä¸è½½Antçåä¸ä¸ªå°æ¹ä¸è½½ã
ANTæ¬èº«å°±æ¯è¿æ ·ä¸ä¸ªæµç¨èæ¬å¼æï¼ç¨äºèªå¨åè°ç¨ç¨åºå®æ项ç®çç¼è¯ï¼æå ï¼æµè¯çã
é¤äºåºäºJAVAæ¯å¹³å°æ å ³çå¤ï¼èæ¬çæ ¼å¼æ¯åºäºXMLçï¼æ¯makeèæ¬æ¥è¯´è¿è¦å¥½ç»´æ¤ä¸äºã
Antæ¯Apacheæä¾ç»Javaå¼å人åçæå»ºå·¥å ·ï¼å®å¯ä»¥å¨WindowsOSåUnixOSä¸è¿è¡ï¼å®ä¸ä» å¼æ¾æºç 并ä¸è¿æ¯ä¸ä¸ªé常好ç¨çå·¥å ·ã
Antæ¯ApacheJakartaä¸ä¸ä¸ªå¾å¥½ç¨çJavaå¼åå·¥å ·ï¼Anté ç½®æ件éç¨XMLææ¡£ç¼åï¼æ以Javaç¨åºåå¯¹å ¶è¯æ³ç¸å½çæï¼Antæ¯ä¸ç¨äºJava项ç®å¹³å°ï¼è½å¤ç¨çº¯Javaæ¥å¼åï¼å®è½å¤è¿è¡äºJavaå®è£ çå¹³å°ï¼å³ä½ç°äºå®ç跨平å°åè½ã
å®ç缺ç¹æ¾ç¤ºæ§è¡ç»æåªè½æ¯DOSå符çé¢ï¼ä¸è½è¿è¡å¤æçjavaç¨åºå¼åã
å è´¹javaå¼åå·¥å ·æåªäº?å®ç¨åjavaå¼åå·¥å ·æJavaWorkshopãBorlandçJBuilderãIBMçVisualAgeforJavaãVisualCafeforJavaãAntçï¼é¤æ¤ä¹å¤è¿è¦å¾å¤å ¶ä»çå¼åå·¥å ·ã
æ谢大家é 读ç±javaé®çå享çâå è´¹javaå¼åå·¥å ·æåªäº?å®ç¨åjavaå¼åå·¥å ·ç¹ç¹?âå¸æ对大家ææ帮å©ï¼äºè§£æ´å¤ä¸ä¸è¯¾ç¨å¹è®å å®¹è¯·å ³æ³¨ææå大éé¸javaå¹è®æºæå®ç½ã
å 责声æï¼ä»¥ä¸å å®¹ä» ä½ä¸ºä¿¡æ¯ä¼ æï¼æä¸é¨åä¿¡æ¯æ¥æºäºäºèç½ï¼ä» ä¾é 读åèã
java小程序源代码,简单点的源码下穿公式源码,多行,免费区块链矿工源码谁有啊
// My car shop.java
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
public class carshop extends JFrame
{
// JPanel to hold all pictures
private JPanel windowJPanel;
private String[] cars = { "",源码"阿斯顿马丁", "美洲虎", "凯迪拉克",
"罗孚", "劳斯莱斯","别克"};
private int[] jiage = { 0,, , ,
, , };
// JLabels for first snack shown
private JLabel oneJLabel;
private JLabel oneIconJLabel;
// JLabels for second snack shown
private JLabel twoJLabel;
private JLabel twoIconJLabel;
// JLabels for third snack shown
private JLabel threeJLabel;
private JLabel threeIconJLabel;
// JLabels for fourth snack shown
private JLabel fourJLabel;
private JLabel fourIconJLabel;
// JLabels for fifth snack shown
private JLabel fiveJLabel;
private JLabel fiveIconJLabel;
// JLabels for sixth snack shown
private JLabel sixJLabel;
private JLabel sixIconJLabel;
// JTextField for displaying snack price
private JTextArea displayJTextArea;
// JLabel and JTextField for user input
private JLabel inputJLabel;
private JComboBox selectCountryJComboBox;
private JLabel inputJLabel2;
private JTextField inputJTextField2;
// JButton to enter user input
private JButton enterJButton;
//JButton to clear the components
private JButton clearJButton;
// no-argument constructor
public carshop()
{
createUserInterface();
}
// create and position GUI components; register event handlers
private void createUserInterface()
{
// get content pane for attaching GUI components
Container contentPane = getContentPane();
// enable explicit positioning of GUI components
contentPane.setLayout( null );
// set up windowJPanel
windowJPanel = new JPanel();
windowJPanel.setBounds( , , , );
windowJPanel.setBorder( new LineBorder( Color.BLACK ) );
windowJPanel.setLayout( null );
contentPane.add( windowJPanel );
// set up oneIconJLabel
oneIconJLabel = new JLabel();
oneIconJLabel.setBounds( , , , );
oneIconJLabel.setIcon( new ImageIcon( "images/阿斯顿马丁.jpg" ) );
windowJPanel.add( oneIconJLabel );
// set up oneJLabel
oneJLabel = new JLabel();
oneJLabel.setBounds( , , , );
oneJLabel.setText( "阿斯顿马丁" );
oneJLabel.setHorizontalAlignment( JLabel.CENTER );
windowJPanel.add( oneJLabel );
// set up twoIconJLabel
twoIconJLabel = new JLabel();
twoIconJLabel.setBounds( , , , );
twoIconJLabel.setIcon( new ImageIcon( "images/美洲虎.jpg" ) );
windowJPanel.add( twoIconJLabel );
// set up twoJLabel
twoJLabel = new JLabel();
twoJLabel.setBounds( , , , );
twoJLabel.setText( "美洲虎" );
twoJLabel.setHorizontalAlignment( JLabel.CENTER );
windowJPanel.add( twoJLabel );
// set up threeIconJLabel
threeIconJLabel = new JLabel();
threeIconJLabel.setBounds( , , , );
threeIconJLabel.setIcon( new ImageIcon(
"images/凯迪拉克.jpg" ) );
windowJPanel.add( threeIconJLabel );
// set up threeJLabel
threeJLabel = new JLabel();
threeJLabel.setBounds( , , , );
threeJLabel.setText( "凯迪拉克" );
threeJLabel.setHorizontalAlignment( JLabel.CENTER );
windowJPanel.add( threeJLabel );
// set up fourIconJLabel
fourIconJLabel = new JLabel();
fourIconJLabel.setBounds( , , , );
fourIconJLabel.setIcon( new ImageIcon( "images/罗孚.jpg" ) );
windowJPanel.add( fourIconJLabel );
// set up fourJLabel
fourJLabel = new JLabel();
fourJLabel.setBounds( , , , );
fourJLabel.setText( "罗孚" );
fourJLabel.setHorizontalAlignment( JLabel.CENTER );
windowJPanel.add( fourJLabel );
// set up fiveIconJLabel
fiveIconJLabel = new JLabel();
fiveIconJLabel.setBounds( , , , );
fiveIconJLabel.setIcon( new ImageIcon(
"images/劳斯莱斯.jpg" ) );
windowJPanel.add( fiveIconJLabel );
// set up fiveJLabel
fiveJLabel = new JLabel();
fiveJLabel.setBounds( , , , );
fiveJLabel.setText( "劳斯莱斯" );
fiveJLabel.setHorizontalAlignment( JLabel.CENTER );
windowJPanel.add( fiveJLabel );
// set up sixIconJLabel
sixIconJLabel = new JLabel();
sixIconJLabel.setBounds( , , , );
sixIconJLabel.setIcon( new ImageIcon( "images/别克.jpg" ) );
windowJPanel.add( sixIconJLabel );
// set up sixJLabel
sixJLabel = new JLabel();
sixJLabel.setBounds( , , , );
sixJLabel.setText( "别克" );
sixJLabel.setHorizontalAlignment( JLabel.CENTER );
windowJPanel.add( sixJLabel );
// set up enterJButton
enterJButton = new JButton();
enterJButton.setBounds( , , , );
enterJButton.setText( "Enter" );
contentPane.add( enterJButton );
enterJButton.addActionListener(
new ActionListener() // anonymous inner class
{
// event handler called when enterJButton is clicked
public void actionPerformed( ActionEvent event )
{
enterJButtonActionPerformed( event );
}
} // end anonymous inner class
); // end call to addActionListener
// set up clearJButton
clearJButton = new JButton();
clearJButton.setBounds( , , , );
clearJButton.setText( "Clear" );
contentPane.add( clearJButton );
// set up inputJLabel
inputJLabel = new JLabel();
inputJLabel.setBounds( , , , );
inputJLabel.setText( "Please make selection:" );
contentPane.add( inputJLabel );
selectCountryJComboBox = new JComboBox( cars );
selectCountryJComboBox.setBounds( , , , );
selectCountryJComboBox.setMaximumRowCount( 3 );
contentPane.add( selectCountryJComboBox );
// set up inputJTextField
inputJLabel2 = new JLabel();
inputJLabel2.setBounds( , , , );
inputJLabel2.setText( "Input the Numble:" );
contentPane.add( inputJLabel2 );
// set up inputJTextField
inputJTextField2 = new JTextField();
inputJTextField2.setBounds( , , , );
inputJTextField2.setHorizontalAlignment( JTextField.RIGHT );
contentPane.add( inputJTextField2 );
clearJButton.addActionListener(
new ActionListener() // anonymous inner class
{
// event handler called when clearJButton is clicked
public void actionPerformed( ActionEvent event )
{
clearJButtonActionPerformed( event );
}
} // end anonymous inner class
);
// set up displayJTextField
displayJTextArea = new JTextArea();
displayJTextArea.setBounds( , ,, );
displayJTextArea.setEditable( false );
contentPane.add( displayJTextArea );
// set properties of application's window
setTitle( "My car Shop" ); // set title bar string
setSize( , ); // set window size
setVisible( true ); // display window
} // end method createUserInterface
private void clearJButtonActionPerformed( ActionEvent event )
{
// clear the JTextFields
inputJTextField2.setText( "" );
displayJTextArea.setText("");
} // end method clearJButtonActionPerformed
private void enterJButtonActionPerformed( ActionEvent event )
{
double z;
double c;
int x;
int y;
x=selectCountryJComboBox.getSelectedIndex();
y=Integer.parseInt(inputJTextField2.getText());
double discountRate;
int amount = Integer.parseInt( inputJTextField2.getText());
switch (amount/5)
{
case 0:
discountRate = 0;
break;
case 1:
discountRate = 1;
break;
case 2:
discountRate = 2;
break;
case 3:
discountRate = 3;
break;
default:
discountRate = 4;
} // end switch statement
c=1-discountRate/;
z=jiage[x]*y*c;
displayJTextArea.append("你选择的是:"+cars[x]+";"+
"它的单价是:"+jiage[x]+";" +"你购买该产品的数量是:"+y+"," +"\n"+"该数量的免费折扣是:"
+discountRate + " %"+";"+"本次消费的总价格是:"+z+"元"+"!"+"\n");
}
public static void main( String args[] )
{
carshop application = new carshop();
application.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
} // end method main
} // end class carshop