Monday, 4 February 2013

Membuat Aplikasi java Netbeans (studi kasus menampilkan data dengan komponen swing)

Standard
Pada tutorial java netbeans kali ini akan membahas pembuatan aplikasi menampilkan data dari komponen swing JcheckBox, jRadioButton, Button Group dan jTextArea kelanjutan dari tutorial sebelumnya. Berikut langkah pembuatan aplikasi praktek2 menampilkan data dari komponen swing :
a. Buat project Praktek2 – klik kanan project – pilih New – Klik jFrame Form
b. Masukkan jLabel (4), jTextField, jCheckBox, jRadioButton (2), jButton dan jTextArea. Atur posisi tiap-tiap komponen. Kemudian ubah propertie masing-masing komponen seperti gambar berikut :
image image
c. Pilih dan drag ButtonGroup dari komponen pallete ke dalam jFrame seperti gambar diatas.

d. Ubah properties jRadioButton1 dan jRadioButton2 pada baris buttonGroup menjadi buttonGroup1, seperti gambar berikut :
image
image
e. Klik kanan pada jCheckBox1, pilih Events > Change > stateChanged
ketikan kode seperti gambar berikut :
image
f. Klik kanan jButton1, pilih Events > Mouse > mouseClicked.
Ketikan kode seperti gambar berikut :
image
g. Compile (F11) dan Jalankan program (F6).
image image
Analisa : Apabila jTextField dan jRadioButton kita inputkan maka akan menghasilkan keluaran yang akan ditampung di jTextArea. Contoh disini adalah jTextField : NUR ROCHIM | Jenis Kelamin : Laki-Laki.
image image
Apabila jCheckBox di centang maka akan menghasilkan jenis huruf tebal pada jTextArea, apabila tidak dicentang maka jenis huruf tetap normal seperti gambar disebelah kanan.
Tambahkan juga Button Clear untuk mereset ulang apabila ingin menginputkan lagi.
Pembahasan
* Kode komponen jCheckBox1
image
Analisa : Koding ini memiliki event stateChange yang bermaksut apabila kotak CheckBox dicentang maka akan tampil berubah.
Script diatas maksutnya adalah apabila jCheckBox1 di centang maka teksnya akan berubah menjadi YA, apabila tidak dicentang teksnya tetap TIDAK.
* Kode komponen jButton1
image
Analisa : Koding ini memiliki Event mouseClicked, apabila jButton di klik maka akan melaksanakan kode program selanjutnya.
Font tebal= new Font("Arial".Font.BOLD.J2);
Font biasa= new Font("Arial".Font.PLAIN.J2);
Script diatas untuk mengatur jenis dan ukuran font. Jangan lupa di baris paling awal kode ditambahkan import java.awt.Font agar font dapat berkerja.
if (jRadioButton1.isSelected())     
{ if (jCheckBox1.isSelected())     
{ jTextArea1.setText("Nama : "+jTextField1.getText()+",\nJenis Kelamin:"+jRadioButton1.getText());     
jTextArea1.setFont(tebal); }     
else{     
jTextArea1.setText("Nama : "+jTextField1.getText()+",\nJenis Kelamin:"+jRadioButton1.getText());     
jTextArea1.setFont(biasa);}     
else if(jRadioButton2.isSelected()){     
if (jCheckBox1.isSelected()){     
jTextArea1.setText("Nama : "+jTextField1.getText()+",Jenis Kelamin:"+jRadioButton2.getText());     
jTextArea1.setFont(tebal);}     
else{     
jTextArea1.setText("Nama : "+jTextField1.getText()+",Jenis Kelamin:"+jRadioButton2.getText());     
jTextArea1.setFont(biasa);}}
Maksut script di atas adalah jika jRadioButton1 dan jCheckBox1 di centang maka jTextArea akan menerima input dari jTextField1 yang berupa nama, Jenis kelamin dari jRadioButton dan jCheckBox yang berjenis huruf tebal atau normal. Script “\n” dimaksutkan untuk jRadioButton agar kedua jRadioButton tidak terpilih semuanya dan hanya terpilih salah satu saja.
*** Selamat mencoba ***

60 comments:

  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Java developer learn from Java Training in Chennai. or learn thru Java Online Training in India . Nowadays Java has tons of job opportunities on various vertical industry.

    ReplyDelete
  2. This is quite educational arrange. It has famous breeding about what I rarity to vouch. Colossal proverb.
    This trumpet is a famous tone to nab to troths. Congratulations on a career well achieved. This arrange is synchronous s informative impolites festivity to pity. I appreciated what you ok extremely here 


    Selenium training in bangalore
    Selenium training in Chennai
    Selenium training in Bangalore
    Selenium training in Pune
    Selenium Online training

    ReplyDelete
  3. Hello today decided to climb on the Internet in search of something interetninkogo and found this site fine baccarat online Today I will withdraw my first mo

    ReplyDelete
  4. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
    Selenium Training in Electronic City

    ReplyDelete
  5. Nice article. I liked very much. All the informations given by you are really helpful for my research. keep on posting your views.
    Java Training in Chennai
    Java Training in Coimbatore
    Java Training in Bangalore

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. This is really an awesome post, thanks for it. Keep adding more information to this.selenium training in bangalore

    ReplyDelete
  8. Really it was an awesome article,very interesting to read.You have provided an nice article,Thanks for sharing.coded ui training in bangalore

    ReplyDelete
  9. Being new to the blogging world I feel like there is still so much to learn. Your tips helped to clarify a few things for me as well as giving.big data testing training in bangalore

    ReplyDelete
  10. Linking is very useful thing.you have really helped lots of people who visit blog and provide them use full information.mobile application testing training in bangalore

    ReplyDelete
  11. Your articles really impressed for me,because of all information so nice.manual testing training in bangalore

    ReplyDelete
  12. Awesome,Thank you so much for sharing such an awesome blog.web designing training in bangalore

    ReplyDelete
  13. Really it was an awesome article,very interesting to read.You have provided an nice article,Thanks for sharing.

    ReplyDelete
  14. Being new to the blogging world I feel like there is still so much to learn. Your tips helped to clarify a few things for me as well as giving.angular 7 training in bangalore

    ReplyDelete
  15. Linking is very useful thing.you have really helped lots of people who visit blog and provide them use full information.sap s4 hana simple finance training in bangalore

    ReplyDelete
  16. I gathered a lot of information through this article.Every example is easy to undestandable and explaining the logic easily.javascript training in bangalore

    ReplyDelete
  17. Very useful and information content has been shared out here, Thanks for sharing it.sap hr training in bangalore

    ReplyDelete
  18. This is really an awesome post, thanks for it. Keep adding more information to this.html training in bangalore

    ReplyDelete
  19. Really i appreciate the effort you made to share the knowledge. The topic here i found was really effective...

    Softgen Infotech is the Best Oracle Training institute located in BTM Layout, Bangalore providing quality training with Realtime Trainers and 100% Job Assistance.

    ReplyDelete
  20. thank you so much for this nice information Article, Digitahanks for sharing your post with us.Real Time Experts training center bangalore

    ReplyDelete
  21. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful . student review for Realtime Experts marathahalli bangalore

    ReplyDelete
  22. I have read your blog its very attractive and impressive. I like it your blog.Real Time Experts Training in Bangalore center address bangalore

    ReplyDelete
  23. Office 365 has number of technical prerequisites that you need to be aware of before you migrate. The main one that catches people out is that Windows XP and Office 2003 are not supported. office 365

    ReplyDelete

  24. You write this post very carefully I think, which is easily understandable to me. Not only this, but another post is also good. As a newbie, this info is really helpful for me. Thanks to you.
    Tally ERP 9 Training
    tally classes
    Tally Training institute in Chennai
    Tally course in Chennai

    ReplyDelete
  25. I feel satisfied to read your blog, you have been delivering a useful & unique information to our vision.keep blogging.
    Digital Marketing Course In Kolkata
    Web Design Course In Kolkata

    ReplyDelete
  26. When I originally commented I seem to have clicked the -Notify me when new comments are added- checkbox and from now on each time a comment is added I recieve 4 emails with the exact same comment. theme Perhaps there is an easy method you are able to remove me from that service? Thanks a lot!

    ReplyDelete
  27. There's definately loads to apprehend approximately this problem. I certainly like all the factors you made guide.

    ReplyDelete
  28. There is always a smarter way to win the task! And if you are looking for ways to unveil that secret, you have landed on the right page. Best Search Engine Optimization services can make your online website perform better. The Web Mines is the company full of creative minds, we are catering SEO services in different countries of the USA. We assure our clients to give the best SEO services. The services we offer our clients are designed according to your business requirements that can fit best in Google algorithms.

    local seo company in usa, local seo the web mines, local seo services pricing, local seo services toronto, local seo services, local seo services atlanta, local seo services companies, local seo services st louis, local seo services in cape town, local seo services usa, local seo services uk, best local seo services, local seo expert company, local seo services for small business, affordable local seo services, local seo marketing company

    ReplyDelete
  29. Thanks for the informative article About Java. This is one of the best resources I have found in quite some time. Nicely written and great info. I really cannot thank you enough for sharing.
    Java training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery

    ReplyDelete
  30. Wow What A Nice And Great Article, Thank You So Much for Giving Us Such a Nice & Helpful Information about Java, keep sending us such informative articles I visit your website on a regular basis.Please refer below if you are looking for best Training Center.
    Java training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery

    ReplyDelete
  31. I have been reading for the past two days about your blogs and topics, still on fetching! Wondering about your words on each line was massively effective. Techno-based information has been fetched in each of your topics. Sure it will enhance and fill the queries of the public needs. thank u so much for sharing this post
    Ai & Artificial Intelligence Course in Chennai
    PHP Training in Chennai
    Ethical Hacking Course in Chennai Blue Prism Training in Chennai
    UiPath Training in Chennai

    ReplyDelete
  32. Thanks a lot for sharing such a good source with all, i appreciate your efforts taken for the same. I found this worth sharing and must share this with all.


    Dot Net Training in Chennai | Dot Net Training in anna nagar | Dot Net Training in omr | Dot Net Training in porur | Dot Net Training in tambaram | Dot Net Training in velachery


    ReplyDelete
  33. The development of artificial intelligence (AI) has propelled more programming architects, information scientists, and different experts to investigate the plausibility of a vocation in machine learning. Notwithstanding, a few newcomers will in general spotlight a lot on hypothesis and insufficient on commonsense application. machine learning projects for final year In case you will succeed, you have to begin building machine learning projects in the near future.

    Projects assist you with improving your applied ML skills rapidly while allowing you to investigate an intriguing point. Furthermore, you can include projects into your portfolio, making it simpler to get a vocation, discover cool profession openings, and Final Year Project Centers in Chennai even arrange a more significant compensation.


    Data analytics is the study of dissecting crude data so as to make decisions about that data. Data analytics advances and procedures are generally utilized in business ventures to empower associations to settle on progressively Python Training in Chennai educated business choices. In the present worldwide commercial center, it isn't sufficient to assemble data and do the math; you should realize how to apply that data to genuine situations such that will affect conduct. In the program you will initially gain proficiency with the specialized skills, including R and Python dialects most usually utilized in data analytics programming and usage; Python Training in Chennai at that point center around the commonsense application, in view of genuine business issues in a scope of industry segments, for example, wellbeing, promoting and account.

    ReplyDelete


Copyright © AIMAGU. Jasa Pembuatan Website. All Rights Reserved
Design by Automattic | Blogger Theme by NewBloggerThemes | Official: www.aimagu.com