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:
Wednesday at 11:58 PM
Ad icon
Colombo
PXN V10 Pro Direct Drive Racing Wheel (Under Warranty)
Abdur Rahman
Updated:
Wednesday at 10:23 PM
Ad icon
USDT ණය සේවාව - USDT Loan Service
පුරවැසියා
Updated:
Wednesday at 4:54 PM
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
Education
Java Help Again
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="kasuwa1235" data-source="post: 18892057" data-attributes="member: 65783"><p>Mata Button 2 k add karala ekata Actions daanna oni , same label eke Me code eke Podi aulak tiyenawa mata eka hadala denawada <img src="/styles/default/xenforo/smilies/default/baffled.gif" class="smilie" loading="lazy" alt=":baffled:" title="Baffled :baffled:" data-shortname=":baffled:" /></p><p></p><p></p><p></p><p>import javax.swing.*;</p><p>import java.awt.event.*;</p><p>import java.awt.event.ActionListener.*;</p><p></p><p></p><p>public class swi9 implements ActionListener{</p><p>private static void cdemo(){</p><p></p><p>JFrame frame = new JFrame ("hi");</p><p>frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);</p><p>frame.setBounds(600,600,600,600);</p><p>frame.getContentPane().setLayout(null);</p><p>JButton butt = new JButton("click me");</p><p>butt.setBounds(20,20,200,20);</p><p>frame.getContentPane().add(butt);</p><p></p><p>JButton butt2 = new JButton("Click Me2");</p><p>butt2.setBounds(25,25,205,25);</p><p>frame.getContentPane().add(butt2);</p><p></p><p>swi9 new1 = new swi9();</p><p>new1.label = new JLabel("");</p><p>new1.label.setBounds(20,40,200,20);</p><p>frame.getContentPane().add(new1.label);</p><p></p><p>butt.addActionListener(new1);</p><p>frame.setVisible(true);</p><p></p><p>}</p><p></p><p>public void actionPerformed(ActionEvent e)</p><p>{</p><p> if(e.getSource()==butt)</p><p> label.setText("Hello World");</p><p> else</p><p> label.setText("Ouchh Cliked");</p><p> }</p><p></p><p>public static void main(String [] args){</p><p> SwingUtilities.invokeLater(new Runnable(){</p><p> public void run(){</p><p> cdemo();</p><p> }</p><p> });</p><p>}</p><p>JLabel label;</p><p></p><p>}</p><p></p><p></p><p></p><p>Error eka Attchment eke ati. mata me Code eka a vidiyatama oni</p><p></p><p>podi waradak aththe eka hadaa ganna hati kiyala dunnoth loku deyak <img src="/styles/default/xenforo/smilies/default/sorry.gif" class="smilie" loading="lazy" alt=":sorry:" title="Sorry :sorry:" data-shortname=":sorry:" /></p></blockquote><p></p>
[QUOTE="kasuwa1235, post: 18892057, member: 65783"] Mata Button 2 k add karala ekata Actions daanna oni , same label eke Me code eke Podi aulak tiyenawa mata eka hadala denawada :baffled: import javax.swing.*; import java.awt.event.*; import java.awt.event.ActionListener.*; public class swi9 implements ActionListener{ private static void cdemo(){ JFrame frame = new JFrame ("hi"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setBounds(600,600,600,600); frame.getContentPane().setLayout(null); JButton butt = new JButton("click me"); butt.setBounds(20,20,200,20); frame.getContentPane().add(butt); JButton butt2 = new JButton("Click Me2"); butt2.setBounds(25,25,205,25); frame.getContentPane().add(butt2); swi9 new1 = new swi9(); new1.label = new JLabel(""); new1.label.setBounds(20,40,200,20); frame.getContentPane().add(new1.label); butt.addActionListener(new1); frame.setVisible(true); } public void actionPerformed(ActionEvent e) { if(e.getSource()==butt) label.setText("Hello World"); else label.setText("Ouchh Cliked"); } public static void main(String [] args){ SwingUtilities.invokeLater(new Runnable(){ public void run(){ cdemo(); } }); } JLabel label; } Error eka Attchment eke ati. mata me Code eka a vidiyatama oni podi waradak aththe eka hadaa ganna hati kiyala dunnoth loku deyak :sorry: [/QUOTE]
Insert quotes…
Verification
Asuwa dahayen wadi kalama keeyada?
Post reply
Top
Bottom