SlideShare ist ein Scribd-Unternehmen logo
1 von 2
Program Klik Sederhana <br />Sintak Program : <br />package eventbutton;<br />import javax.swing.*;<br />import java.awt.event.*;<br />import java.awt.*;<br />/**<br /> *<br /> * @author Henfryandie<br /> */<br />public class klikSaja {<br />        private static String labelPrefix = quot;
Button Telah di klik sebanyak : quot;
;<br />        private int numklik =0;<br />        <br />        public Component createComponents(){<br />            final JLabel label = new JLabel (labelPrefix + quot;
0 Kaliquot;
);<br />        <br />        JButton tombol = new JButton(quot;
Di Klik sajaquot;
);<br />        <br />        tombol.addActionListener(new ActionListener(){<br />           public void actionPerformed(ActionEvent e) {<br />               numklik++;<br />               label.setText(labelPrefix+numklik +quot;
 Kaliquot;
);<br />           }<br />        });<br />        label.setLabelFor(tombol);<br />        <br />        JPanel pane = new JPanel();<br />        pane.setBorder(BorderFactory.createEmptyBorder(30, 30, 10, 30));<br />        pane.setLayout(new GridLayout(0,1));<br />        pane.add(tombol);<br />        pane.add(label);<br />        <br />        return pane;<br />        <br />        }<br />    public static void main(String[] args) {<br />            JFrame frame = new JFrame(quot;
Contohquot;
);<br />            klikSaja app = new klikSaja();<br />            Component contents = app.createComponents();<br />            frame.getContentPane().add(contents, BorderLayout.CENTER);<br />            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);<br />            frame.pack();<br />            frame.setVisible(true);<br />    }<br />}<br />
Program klik sederhana

Weitere Àhnliche Inhalte

Was ist angesagt?

VISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEVISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEDarwin Durand
 
Phoenix for laravel developers
Phoenix for laravel developersPhoenix for laravel developers
Phoenix for laravel developersLuiz Messias
 
Adding a action listener to button
Adding a action listener to buttonAdding a action listener to button
Adding a action listener to buttonyugandhar vadlamudi
 
A Series of Fortunate Events - Drupalcon Europe, Amsterdam 2014
A Series of Fortunate Events - Drupalcon Europe, Amsterdam 2014A Series of Fortunate Events - Drupalcon Europe, Amsterdam 2014
A Series of Fortunate Events - Drupalcon Europe, Amsterdam 2014Matthias Noback
 
C Programming Language Step by Step Part 5
C Programming Language Step by Step Part 5C Programming Language Step by Step Part 5
C Programming Language Step by Step Part 5Rumman Ansari
 
A Series of Fortunate Events - Symfony Camp Sweden 2014
A Series of Fortunate Events - Symfony Camp Sweden 2014A Series of Fortunate Events - Symfony Camp Sweden 2014
A Series of Fortunate Events - Symfony Camp Sweden 2014Matthias Noback
 
Php Chapter 1 Training
Php Chapter 1 TrainingPhp Chapter 1 Training
Php Chapter 1 TrainingChris Chubb
 
Signalsど゙ Eventć‡Šç†ă‚’ç°Ąć˜ă«
Signalsど゙ Eventć‡Šç†ă‚’ç°Ąć˜ă«Signalsど゙ Eventć‡Šç†ă‚’ç°Ąć˜ă«
Signalsど゙ Eventć‡Šç†ă‚’ç°Ąć˜ă«Hiroaki Okubo
 
Chapter 11.5
Chapter 11.5Chapter 11.5
Chapter 11.5sotlsoc
 
C Programming Language Part 7
C Programming Language Part 7C Programming Language Part 7
C Programming Language Part 7Rumman Ansari
 
Assignment 2 lab 3 python gpa calculator
Assignment 2 lab 3  python gpa calculatorAssignment 2 lab 3  python gpa calculator
Assignment 2 lab 3 python gpa calculatorNagiob Doma
 
Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2PRN USM
 

Was ist angesagt? (18)

Swing
SwingSwing
Swing
 
Lecture8 oopj
Lecture8 oopjLecture8 oopj
Lecture8 oopj
 
VISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLEVISUALIZAR REGISTROS EN UN JTABLE
VISUALIZAR REGISTROS EN UN JTABLE
 
Phoenix for laravel developers
Phoenix for laravel developersPhoenix for laravel developers
Phoenix for laravel developers
 
2013 28-03-dak-why-fp
2013 28-03-dak-why-fp2013 28-03-dak-why-fp
2013 28-03-dak-why-fp
 
Adding a action listener to button
Adding a action listener to buttonAdding a action listener to button
Adding a action listener to button
 
A Series of Fortunate Events - Drupalcon Europe, Amsterdam 2014
A Series of Fortunate Events - Drupalcon Europe, Amsterdam 2014A Series of Fortunate Events - Drupalcon Europe, Amsterdam 2014
A Series of Fortunate Events - Drupalcon Europe, Amsterdam 2014
 
Demo
DemoDemo
Demo
 
Oop lecture9 10
Oop lecture9 10Oop lecture9 10
Oop lecture9 10
 
C Programming Language Step by Step Part 5
C Programming Language Step by Step Part 5C Programming Language Step by Step Part 5
C Programming Language Step by Step Part 5
 
A Series of Fortunate Events - Symfony Camp Sweden 2014
A Series of Fortunate Events - Symfony Camp Sweden 2014A Series of Fortunate Events - Symfony Camp Sweden 2014
A Series of Fortunate Events - Symfony Camp Sweden 2014
 
Php Chapter 1 Training
Php Chapter 1 TrainingPhp Chapter 1 Training
Php Chapter 1 Training
 
Signalsど゙ Eventć‡Šç†ă‚’ç°Ąć˜ă«
Signalsど゙ Eventć‡Šç†ă‚’ç°Ąć˜ă«Signalsど゙ Eventć‡Šç†ă‚’ç°Ąć˜ă«
Signalsど゙ Eventć‡Šç†ă‚’ç°Ąć˜ă«
 
Chapter 11.5
Chapter 11.5Chapter 11.5
Chapter 11.5
 
C Programming Language Part 7
C Programming Language Part 7C Programming Language Part 7
C Programming Language Part 7
 
Assignment 2 lab 3 python gpa calculator
Assignment 2 lab 3  python gpa calculatorAssignment 2 lab 3  python gpa calculator
Assignment 2 lab 3 python gpa calculator
 
Add tab jtabbedpane
Add tab jtabbedpaneAdd tab jtabbedpane
Add tab jtabbedpane
 
Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2Graphical User Interface (GUI) - 2
Graphical User Interface (GUI) - 2
 

Andere mochten auch

Almacenamiento2
Almacenamiento2Almacenamiento2
Almacenamiento2vevaldivieso
 
DÉFI SANTÉ LIBERTÉ
DÉFI SANTÉ LIBERTÉDÉFI SANTÉ LIBERTÉ
DÉFI SANTÉ LIBERTÉCatherine Bazin
 
Como navegar de manera segura en internet
Como navegar de manera segura en internetComo navegar de manera segura en internet
Como navegar de manera segura en internetRaul Villacreses
 
Semiconductores ok
Semiconductores okSemiconductores ok
Semiconductores okfsilvac
 
Computacion daysi
Computacion daysiComputacion daysi
Computacion daysideboocris
 
9 8 session 7
9 8 session 79 8 session 7
9 8 session 7nblock
 
2016_08Aug_AOK_ECMH_GuideJH
2016_08Aug_AOK_ECMH_GuideJH2016_08Aug_AOK_ECMH_GuideJH
2016_08Aug_AOK_ECMH_GuideJHJulie Herzog
 
Herramientas web 2
Herramientas web 2Herramientas web 2
Herramientas web 2Liset Katerine
 
Acervo Firpo: Documentos
Acervo Firpo: DocumentosAcervo Firpo: Documentos
Acervo Firpo: Documentosalinehasegawa
 
Bab vi indeks dan inflasi
Bab vi indeks dan inflasiBab vi indeks dan inflasi
Bab vi indeks dan inflasiirfan987
 
VEHICLES SOLARS
VEHICLES SOLARSVEHICLES SOLARS
VEHICLES SOLARSASSRPA
 
Uma Narrativa de Lucélia-SP: o Avanço do Capital no Oeste do Estado de São Pa...
Uma Narrativa de Lucélia-SP: o Avanço do Capital no Oeste do Estado de São Pa...Uma Narrativa de Lucélia-SP: o Avanço do Capital no Oeste do Estado de São Pa...
Uma Narrativa de Lucélia-SP: o Avanço do Capital no Oeste do Estado de São Pa...alinehasegawa
 
Conduct demographic research to
Conduct demographic research toConduct demographic research to
Conduct demographic research toMoses Lutta
 
Presentation2
Presentation2Presentation2
Presentation2robcar1986
 

Andere mochten auch (20)

Almacenamiento2
Almacenamiento2Almacenamiento2
Almacenamiento2
 
DÉFI SANTÉ LIBERTÉ
DÉFI SANTÉ LIBERTÉDÉFI SANTÉ LIBERTÉ
DÉFI SANTÉ LIBERTÉ
 
Como navegar de manera segura en internet
Como navegar de manera segura en internetComo navegar de manera segura en internet
Como navegar de manera segura en internet
 
Semiconductores ok
Semiconductores okSemiconductores ok
Semiconductores ok
 
Computacion daysi
Computacion daysiComputacion daysi
Computacion daysi
 
Presentacion intercambio guadalix miraflores
Presentacion intercambio guadalix mirafloresPresentacion intercambio guadalix miraflores
Presentacion intercambio guadalix miraflores
 
9 8 session 7
9 8 session 79 8 session 7
9 8 session 7
 
2016_08Aug_AOK_ECMH_GuideJH
2016_08Aug_AOK_ECMH_GuideJH2016_08Aug_AOK_ECMH_GuideJH
2016_08Aug_AOK_ECMH_GuideJH
 
Verdi. aprentic
Verdi. aprenticVerdi. aprentic
Verdi. aprentic
 
MatemĂĄgica
MatemĂĄgicaMatemĂĄgica
MatemĂĄgica
 
Herramientas web 2
Herramientas web 2Herramientas web 2
Herramientas web 2
 
Acervo Firpo: Documentos
Acervo Firpo: DocumentosAcervo Firpo: Documentos
Acervo Firpo: Documentos
 
Bab vi indeks dan inflasi
Bab vi indeks dan inflasiBab vi indeks dan inflasi
Bab vi indeks dan inflasi
 
Mar virtual
Mar virtualMar virtual
Mar virtual
 
VEHICLES SOLARS
VEHICLES SOLARSVEHICLES SOLARS
VEHICLES SOLARS
 
Uma Narrativa de Lucélia-SP: o Avanço do Capital no Oeste do Estado de São Pa...
Uma Narrativa de Lucélia-SP: o Avanço do Capital no Oeste do Estado de São Pa...Uma Narrativa de Lucélia-SP: o Avanço do Capital no Oeste do Estado de São Pa...
Uma Narrativa de Lucélia-SP: o Avanço do Capital no Oeste do Estado de São Pa...
 
PresentaciĂłn1 (1)
PresentaciĂłn1 (1)PresentaciĂłn1 (1)
PresentaciĂłn1 (1)
 
Ms Hessen Counseling Secretary
Ms Hessen Counseling SecretaryMs Hessen Counseling Secretary
Ms Hessen Counseling Secretary
 
Conduct demographic research to
Conduct demographic research toConduct demographic research to
Conduct demographic research to
 
Presentation2
Presentation2Presentation2
Presentation2
 

Ähnlich wie Program klik sederhana

Why am I getting an out of memory error and no window of my .pdf
Why am I getting an out of memory error and no window of my .pdfWhy am I getting an out of memory error and no window of my .pdf
Why am I getting an out of memory error and no window of my .pdfaakarcreations1
 
Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.Kuldeep Jain
 
10 awt event model
10 awt event model10 awt event model
10 awt event modelBayarkhuu
 
package buttongui; import static com.sun.deploy.config.JREInf.pdf
package buttongui; import static com.sun.deploy.config.JREInf.pdfpackage buttongui; import static com.sun.deploy.config.JREInf.pdf
package buttongui; import static com.sun.deploy.config.JREInf.pdfarjuntiwari586
 
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdfPLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdfmohammedfootwear
 
import javax.swing.; import java.awt.; import java.awt.event..pdf
import javax.swing.; import java.awt.; import java.awt.event..pdfimport javax.swing.; import java.awt.; import java.awt.event..pdf
import javax.swing.; import java.awt.; import java.awt.event..pdfarwholesalelors
 
Groovy-er desktop applications with Griffon
Groovy-er desktop applications with GriffonGroovy-er desktop applications with Griffon
Groovy-er desktop applications with GriffonEric Wendelin
 
Groovy-er Desktop Applications With Griffon
Groovy-er Desktop Applications With GriffonGroovy-er Desktop Applications With Griffon
Groovy-er Desktop Applications With GriffonMatthew McCullough
 
JButton in Java Swing example
JButton in Java Swing example JButton in Java Swing example
JButton in Java Swing example yugandhar vadlamudi
 
Write a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdfWrite a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdffathimaoptical
 
011 more swings_adv
011 more swings_adv011 more swings_adv
011 more swings_advChaimaa Kabb
 
This is the code for the above 5 public class Input extends JFram.pdf
This is the code for the above 5 public class Input extends JFram.pdfThis is the code for the above 5 public class Input extends JFram.pdf
This is the code for the above 5 public class Input extends JFram.pdfDEEPAKSONI562
 
Ejemplos Interfaces Usuario 3
Ejemplos Interfaces Usuario 3Ejemplos Interfaces Usuario 3
Ejemplos Interfaces Usuario 3martha leon
 
In Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdfIn Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdfflashfashioncasualwe
 
Program-a. library is importedimport java.awt.; import j.pdf
Program-a. library is importedimport java.awt.; import j.pdfProgram-a. library is importedimport java.awt.; import j.pdf
Program-a. library is importedimport java.awt.; import j.pdfaparnacollection
 
GUI Programming with Java
GUI Programming with JavaGUI Programming with Java
GUI Programming with JavaJussi Pohjolainen
 
package net.codejava.swing.mail;import java.awt.Font;import java.pdf
package net.codejava.swing.mail;import java.awt.Font;import java.pdfpackage net.codejava.swing.mail;import java.awt.Font;import java.pdf
package net.codejava.swing.mail;import java.awt.Font;import java.pdfsudhirchourasia86
 

Ähnlich wie Program klik sederhana (20)

ch20.pptx
ch20.pptxch20.pptx
ch20.pptx
 
Why am I getting an out of memory error and no window of my .pdf
Why am I getting an out of memory error and no window of my .pdfWhy am I getting an out of memory error and no window of my .pdf
Why am I getting an out of memory error and no window of my .pdf
 
Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.
 
10 awt event model
10 awt event model10 awt event model
10 awt event model
 
package buttongui; import static com.sun.deploy.config.JREInf.pdf
package buttongui; import static com.sun.deploy.config.JREInf.pdfpackage buttongui; import static com.sun.deploy.config.JREInf.pdf
package buttongui; import static com.sun.deploy.config.JREInf.pdf
 
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdfPLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
PLEASE HELP ME !!IT IS Due Tonight ;(!i have to submit it before.pdf
 
import javax.swing.; import java.awt.; import java.awt.event..pdf
import javax.swing.; import java.awt.; import java.awt.event..pdfimport javax.swing.; import java.awt.; import java.awt.event..pdf
import javax.swing.; import java.awt.; import java.awt.event..pdf
 
Groovy-er desktop applications with Griffon
Groovy-er desktop applications with GriffonGroovy-er desktop applications with Griffon
Groovy-er desktop applications with Griffon
 
Groovy-er Desktop Applications With Griffon
Groovy-er Desktop Applications With GriffonGroovy-er Desktop Applications With Griffon
Groovy-er Desktop Applications With Griffon
 
JButton in Java Swing example
JButton in Java Swing example JButton in Java Swing example
JButton in Java Swing example
 
java2 swing
java2 swingjava2 swing
java2 swing
 
Write a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdfWrite a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdf
 
011 more swings_adv
011 more swings_adv011 more swings_adv
011 more swings_adv
 
This is the code for the above 5 public class Input extends JFram.pdf
This is the code for the above 5 public class Input extends JFram.pdfThis is the code for the above 5 public class Input extends JFram.pdf
This is the code for the above 5 public class Input extends JFram.pdf
 
Ejemplos Interfaces Usuario 3
Ejemplos Interfaces Usuario 3Ejemplos Interfaces Usuario 3
Ejemplos Interfaces Usuario 3
 
In Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdfIn Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdf
 
Program-a. library is importedimport java.awt.; import j.pdf
Program-a. library is importedimport java.awt.; import j.pdfProgram-a. library is importedimport java.awt.; import j.pdf
Program-a. library is importedimport java.awt.; import j.pdf
 
GUI Programming with Java
GUI Programming with JavaGUI Programming with Java
GUI Programming with Java
 
Java awt
Java awtJava awt
Java awt
 
package net.codejava.swing.mail;import java.awt.Font;import java.pdf
package net.codejava.swing.mail;import java.awt.Font;import java.pdfpackage net.codejava.swing.mail;import java.awt.Font;import java.pdf
package net.codejava.swing.mail;import java.awt.Font;import java.pdf
 

KĂŒrzlich hochgeladen

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel AraĂșjo
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 

KĂŒrzlich hochgeladen (20)

A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 

Program klik sederhana

  • 1. Program Klik Sederhana <br />Sintak Program : <br />package eventbutton;<br />import javax.swing.*;<br />import java.awt.event.*;<br />import java.awt.*;<br />/**<br /> *<br /> * @author Henfryandie<br /> */<br />public class klikSaja {<br /> private static String labelPrefix = quot; Button Telah di klik sebanyak : quot; ;<br /> private int numklik =0;<br /> <br /> public Component createComponents(){<br /> final JLabel label = new JLabel (labelPrefix + quot; 0 Kaliquot; );<br /> <br /> JButton tombol = new JButton(quot; Di Klik sajaquot; );<br /> <br /> tombol.addActionListener(new ActionListener(){<br /> public void actionPerformed(ActionEvent e) {<br /> numklik++;<br /> label.setText(labelPrefix+numklik +quot; Kaliquot; );<br /> }<br /> });<br /> label.setLabelFor(tombol);<br /> <br /> JPanel pane = new JPanel();<br /> pane.setBorder(BorderFactory.createEmptyBorder(30, 30, 10, 30));<br /> pane.setLayout(new GridLayout(0,1));<br /> pane.add(tombol);<br /> pane.add(label);<br /> <br /> return pane;<br /> <br /> }<br /> public static void main(String[] args) {<br /> JFrame frame = new JFrame(quot; Contohquot; );<br /> klikSaja app = new klikSaja();<br /> Component contents = app.createComponents();<br /> frame.getContentPane().add(contents, BorderLayout.CENTER);<br /> frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);<br /> frame.pack();<br /> frame.setVisible(true);<br /> }<br />}<br />