Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Ad icon
ZTE MF283U 4G Unlocked Router (Used)
ayanthamaxi
Updated:
Sunday at 8:26 PM
ලංකාවේ හොඳම උපකාරක පන්ති සහ ගුරුවරුන් එකම තැනකින් - TopTuition.lk
dulithapathum
Updated:
Saturday at 8:07 AM
Colombo
RidhMathraa ’26 🎶✨
Tmadhusanka
Updated:
Jul 15, 2026
Ad icon
Colombo
PXN V10 Pro Direct Drive Racing Wheel (Under Warranty)
Abdur Rahman
Updated:
Jul 15, 2026
Ad icon
USDT ණය සේවාව - USDT Loan Service
පුරවැසියා
Updated:
Jul 15, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
Java Help
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="v7soft1" data-source="post: 18888043" data-attributes="member: 451987"><p>[CODE]import java.awt.BorderLayout;</p><p>import java.awt.CardLayout;</p><p>import java.awt.event.ActionEvent;</p><p>import java.awt.event.ActionListener;</p><p>import javax.swing.JButton;</p><p>import javax.swing.JFrame;</p><p>import javax.swing.JLabel;</p><p>import javax.swing.SwingUtilities;</p><p></p><p>/**</p><p> *</p><p> * @author tdd</p><p> */</p><p>public class Main implements ActionListener {</p><p></p><p> int clickCount = 0;</p><p> JLabel label;</p><p></p><p> private static void createAndShowGUI() {</p><p> JButton butt = new JButton("Click me");</p><p> JFrame frame = new JFrame("I am a JFrame");</p><p> frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);</p><p> frame.setBounds(20, 30, 30, 30);</p><p> </p><p> butt.setBounds(20, 30, 200, 100);</p><p> frame.getContentPane().setLayout(new BorderLayout());</p><p></p><p></p><p> frame.getContentPane();</p><p></p><p> Main app = new Main();</p><p></p><p> app.label = new JLabel("0 clicks");</p><p> app.label.setBounds(20, 40, 200, 20);</p><p> frame.add(app.label,BorderLayout.NORTH);</p><p> frame.add(butt,BorderLayout.SOUTH);</p><p> </p><p> butt.addActionListener(app);</p><p> frame.setSize(500, 500);</p><p> frame.setVisible(true);</p><p> }</p><p></p><p> @Override</p><p> public void actionPerformed(ActionEvent e) {</p><p> clickCount++;</p><p> label.setText("Clicks = " + clickCount);</p><p> }</p><p></p><p> public static void main(String[] args) {</p><p> SwingUtilities.invokeLater(new Runnable() {</p><p> @Override</p><p> public void run() {</p><p> createAndShowGUI();</p><p> }</p><p> });</p><p> }</p><p>}</p><p>[/CODE]</p><p>class name akkath Main.java wenna one</p><p>godak kalekin se akak gauwe ubata help akak wai</p></blockquote><p></p>
[QUOTE="v7soft1, post: 18888043, member: 451987"] [CODE]import java.awt.BorderLayout; import java.awt.CardLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.SwingUtilities; /** * * @author tdd */ public class Main implements ActionListener { int clickCount = 0; JLabel label; private static void createAndShowGUI() { JButton butt = new JButton("Click me"); JFrame frame = new JFrame("I am a JFrame"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setBounds(20, 30, 30, 30); butt.setBounds(20, 30, 200, 100); frame.getContentPane().setLayout(new BorderLayout()); frame.getContentPane(); Main app = new Main(); app.label = new JLabel("0 clicks"); app.label.setBounds(20, 40, 200, 20); frame.add(app.label,BorderLayout.NORTH); frame.add(butt,BorderLayout.SOUTH); butt.addActionListener(app); frame.setSize(500, 500); frame.setVisible(true); } @Override public void actionPerformed(ActionEvent e) { clickCount++; label.setText("Clicks = " + clickCount); } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { createAndShowGUI(); } }); } } [/CODE] class name akkath Main.java wenna one godak kalekin se akak gauwe ubata help akak wai [/QUOTE]
Insert quotes…
Verification
Asuwa dahayen wadi kalama keeyada?
Post reply
Top
Bottom