Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML


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

 
Facing Programming Problem?
Ask Questions?, Browse Latest Questions, Question-Answer Guidelines
Java
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

Create a JSpinner Component in Java

                         

In this section, you will learn how to create a JSpinner component of swing. The JSpinner provides the up-down arrow buttons which are used to increase or decrease the numeric value.

This program provides an appropriate JSpinner component on the frame. The following figure shows that:

Swing JSpinner Component

This program have used the following methods or API's components for appropriate:

JSpinnerComp():
This is the constructor of JSpinnerComp class. This constructor used for displaying the JSpinner component on the frame.

JSpinner():
This is the constructor of JSpinner class. It extends form the JComponent class. This is used to create a spinner. It takes the initial value "0" by default.

Here is the code of program:

import javax.swing.*;
import java.awt.*;
import java.util.*;

public class JSpinnerComp{
  public static void main(String[] args) {
    JSpinnerComp h = new JSpinnerComp();
  }

  public JSpinnerComp(){
    JFrame frame = new JFrame("Creating a JSpinner Component");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    JSpinner spinner = new JSpinner();
    frame.add(spinner,BorderLayout.NORTH);
    frame.setSize(100,100);
    frame.setVisible(true);
  }
}

Download this example

                         

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Latest Searches:
attachment-replacement
download tomcate 5.0
binary to hexadecimal
adding image in j2ee
combo box field call a
static variable
program to validate us
remove rectangle
selecting option value
ะà¸??ะà¸?ย ะà
application of java we
hybernet
login window
login
get column count colu
Struts Dispatch Action
Player Class in the Ja
jsp
JSP MailCOde
periodic table java ap
delete
breakะ�ะ?????ะ
parse a int to string
JPA Tutorials
display the sum of 20
easy struts eclipse
constructor without pa
code for how i reduce
Java Mysql
Java Tutorial
HTTP method GET is not
selecting multiple fil
radio button in html
Pattern Testing
JTextArea background
how to call pl/sql fro
java date compare exam
Accessing data structu
jQuery To Slide Effect
Java Tutorials
sequential number gene
update query Example
types of webserver
namespace image
connection pooling wit
array element in php
code for insert date,m
java open output file
multipage
window
diasplaying data from
da
activate email account
hello world sample in
C shell
session.get
sum
jsf table
tab library
visual C++ 6.0
arraylist examples usi
how to add number of d
online bookstore in ja
jsf empty string
flush() method in hibe
substring/com/gallery/
how to run a servlet f
date jsp
net use
Excel open java applic
IBM WebSphere Applicat
basic about struts
Javascript Windows and
Create
display
interfaces
sequential
logic iterate
Maya Effects Interpart
JAIDraw
Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
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

Indian Software Development Company | iPhone Development Company in India | Java Training Delhi | Java Training at Noida |

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

Copyright © 2008. All rights reserved.