Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , , ,

Sponsored Links


AbstractButton class of java

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 22-02-2010
Member
 
Join Date: Dec 2009
Posts: 32
AbstractButton class of java

Sponsored Links
Hello guys,

I have to discuss one of my query related to the java inbuilt classes. I want to be aware about the AbstractButton class. I don't know nothing about the AbstractButton class of java programming. I have referred many websites for AbstractButton class, but nothing was helpful. If you knows anything about the AbstractButton class then please let me aware about that. I would greatly appreciate your any help.

Reply With Quote
  #2  
Old 22-02-2010
Praetor's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,943
Re: AbstractButton class of java

Hi,

A AbstractButton class of java is used for to describe common behaviors of menu items and buttons. This class is hired from 'javax.swing.JComponent' package of java. This java class implements many interfaces such as ImageObserver, ItemSelectable, MenuContainer, Serializable, SwingConstants. There are three direct subclasses of AbstractButton class and which are namely JButton, JMenuItem, JToggleButton.
Reply With Quote
  #3  
Old 22-02-2010
Member
 
Join Date: May 2008
Posts: 2,000
Re: AbstractButton class of java

Hi friend,

Please refer following example of AbstractButton of java:
Code:
import javax.swing.AbstractButton;
import javax.swing.JFrame;

public class AbstractButtonDemo {

  public static void main(String[] amb) {
    JFrame frame1 = new JFrame();
    frame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    AbstractButton bn1 = new JButton();
    bn1.setMultiClickThreshhold(1000);
    
     bn.addActionListener(new ActionListener(){
      public void actionPerformed(ActionEvent e) {
        System.out.println("action");      }
     };

    frame1.add(bn1);

    frame1.setSize(400, 200);
    frame1.setVisible(true);
  }
}
Reply With Quote
  #4  
Old 22-02-2010
kelfro's Avatar
Member
 
Join Date: Apr 2008
Posts: 1,989
Re: AbstractButton class of java

Hello friend,

I suggest you to go through the following some methods of 'AbstractButton class':
  • setVerticalTextPosition(int txtPosition)
  • setVerticalAlignment(int align)
  • setSelectedIcon(Icon icn)
  • setRolloverSelectedIcon(Icon icn)
  • setRolloverIcon(Icon icn)
Reply With Quote
  #5  
Old 22-02-2010
Zecho's Avatar
Member
 
Join Date: May 2008
Posts: 2,278
Re: AbstractButton class of java

Following example will show you how to use methods of 'AbstractButton class'
Code:
import javax.swing.JFrame;
import javax.swing.AbstractButton;

public class HTMLAbstractButtonDM 
{

  public static void main(String[] aw) {
    JFrame bck = new JFrame();
    bck.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    AbstractButton bn = new JButton();
    bn.setText ("<html>Last Name<br><font face='courier new'"
        + " color=red> (mandatory) </font></html>");
    bck.add(bn);

    bck.setSize(400, 200);
    bck.setVisible(true);
  }

}
Reply With Quote
  #6  
Old 22-02-2010
Reegan's Avatar
Member
 
Join Date: Oct 2005
Posts: 2,381
Re: AbstractButton class of java

Hi,

If you want to know about the nested classes of AbstractButton class of java, then refer following classes:
  1. AbstractButton.ButtonChangeListener
  2. Component.FlipBufferStrategy
  3. Container.AccessibleAWTContainer
  4. AbstractButton.AccessibleAbstractButton
  5. Component.AccessibleAWTComponent
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "AbstractButton class of java"
Thread Thread Starter Forum Replies Last Post
Converting java class to java bean class Ucchal Software Development 6 09-08-2010 10:24 AM
What is the use of Rectangle class in java? Gokul20 Software Development 5 06-03-2010 02:46 PM
MenuItem class of java Zecho Software Development 4 05-03-2010 07:30 PM
JFormattedTextField class of java Khan Baba Software Development 5 17-02-2010 10:37 AM
Java Programming Language Basics: Reflection Basics and Class Class mayuri_gunjan Guides & Tutorials 6 29-08-2005 12:04 AM


All times are GMT +5.5. The time now is 06:40 PM.