Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML


 

Java Tutorials


 

 

Struts Tutorials

Struts Resources

Visit Forum! Post Questions!
Jobs At RoseIndia.net!

Java Example Java Swing ChangeButtonLabel

User Comments
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl
  Blink   Furl   Simpy   Y! MyWeb 

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

6 comments so far (post your own) View All Comments Latest 10 Comments:

Button.setBounds (600, 375, 59, 46);

Posted by IT on Monday, 10.26.09 @ 18:53pm | #92136

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
class ButtonOn extends JFrame implements ActionListener
{
JButton b1=new JButton("ON");
public ButtonOn()
{
super("sam Button");
//Container c=getContentPane();
JPanel c=new JPanel();
c.setLayout(new FlowLayout());
c.add(b1);
setSize(400,400);
setVisible(true);
add(c);
b1.addActionListener(this);
}
public void actionPerformed(ActionEvent ae)
{
String text = (String)ae.getActionCommand();
JOptionPane.showMessageDialog(null, text);
if (text.equals("ON"))
{
b1.setText("OFF");
}
else
{
b1.setText("ON");
}
}
}
class UseButtonOn
{
public static void main(String ar[])
{
ButtonOn s=new ButtonOn();
}
}

Posted by saurabh on Thursday, 05.28.09 @ 20:02pm | #88103

Please tell me How can I set the position of a button on a frame?

Posted by Jyoti on Tuesday, 05.6.08 @ 18:53pm | #58642

Hi! Great lesson.

I'm wondering how to change the text of a button and menu option simultaneously by changing the associated Action object. I tried by changing the NAME property of the associated Action, but that didn't seem to work.

Thanks!
Orion

Posted by Orion Carrier on Monday, 02.11.08 @ 22:46pm | #47929

This website helped us a lot while doing our projects. i wish ur service continues...

Posted by Tamil on Friday, 01.25.08 @ 15:49pm | #46127

"ChangButtonLabel cl = new ChangButtonLabel();" should be ChangeButtonLabel cl = new ChangeButtonLabel();


thanks for your lessons...

Posted by bora ciner on Thursday, 12.7.06 @ 15:59pm | #593

Ask programming questions?

 

 

Back to Tutorial

 

  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification

Tell A Friend
Your Friend Name

 

 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright 2007. All rights reserved.