Results 1 to 5 of 5

Thread: Don't know about Spring class of java

  1. #1
    Join Date
    Dec 2009
    Posts
    41

    Don't know about Spring class of java

    Hello Friend,

    I have to discuss one of my query related to the java classes. I want to be aware about the 'Class Spring' of java. I don't any idea about the use of Spring class of java. I only know that, Spring class of java is related to the something about the properties. If you have enough knowledge about the Spring class of java, then please share it with me. I would appreciate your help greatly.

  2. #2
    Join Date
    Feb 2008
    Posts
    1,852

    Re: Don't know about Spring class of java

    Hi Friend,

    Spring class of java is essential to store varies properties that are used for it's behavior characterization. Spring class of java is basically extended from java package known as 'java.lang.Object'. The Spring class of instance useful for to mechanical spring visualization. This mechanism is very useful to make corrective force for the spring behavior. The spring class of java normally taken from 'javax.swing.Spring' package.

  3. #3
    Join Date
    Jan 2008
    Posts
    1,521

    Re: Don't know about Spring class of java

    An instance of the Spring class holds three properties that characterize its behavior: the minimum, preferred, and maximum values. Each of these properties may be involved in defining its fourth, value, property based on a series of rules. An instance of the Spring class can be visualized as a mechanical spring that provides a corrective force as the spring is compressed or stretched away from its preferred value.

  4. #4
    Join Date
    Apr 2008
    Posts
    1,948

    Re: Don't know about Spring class of java

    Hi,

    I suggest you to refer following methods of the 'Spring class':
    • height(Component cm)
    • scale(Spring sp, float fr)
    • setValue(int val)
    • constant(int minm, int prefr, int maxm)
    • constant(int prefr)

  5. #5
    Join Date
    May 2008
    Posts
    2,012

    Re: Don't know about Spring class of java

    Example of Spring class of java:
    Code:
    class Spring {
        private static SpringFactory s_factory1 = new SpringFactory();
        public static SpringFactory getFactory() {
            return s_factory1;
        } 
        public Spring(ForceItem fi1, ForceItem fi2, float k, float len) {
            item1 = fi1;
            item2 = fi2;
            coeff = k;
            length = len;
        }
        public ForceItem item01;
        public ForceItem item02;
        public float length;
        public static final class SpringFactory {
            private ArrayList springs = new ArrayList();
            public Spring getSpring(ForceItem f01, ForceItem f02, float k, float length) {
                if ( springs.size() > 0 ) {
                    Spring si = (Spring)springs.remove(springs.size()-1);
                    si.item01 = f01;
                    si.item02 = f02;
                    si.coeff = k;
                    si.length = length;
                    return s;
                } else {
                    return new Spring(f1,f2,k,length);
                }
            } 
            public void reclaim(Spring s) {
                si.item1 = null;
                si.item2 = null;
                if ( springs.size() < maxSprings )
                   springs.add(s);
            }     }
    }

Similar Threads

  1. Converting java class to java bean class
    By Ucchal in forum Software Development
    Replies: 6
    Last Post: 09-08-2010, 10:24 AM
  2. MenuItem class of java
    By Zecho in forum Software Development
    Replies: 4
    Last Post: 05-03-2010, 08:30 PM
  3. JTextArea class of java
    By Ram Bharose in forum Software Development
    Replies: 5
    Last Post: 13-02-2010, 11:06 AM
  4. Why Spring, Benefits using spring framework?
    By Mahendra varma in forum Software Development
    Replies: 3
    Last Post: 25-04-2009, 10:27 AM
  5. Java Programming Language Basics: Reflection Basics and Class Class
    By mayuri_gunjan in forum Guides & Tutorials
    Replies: 6
    Last Post: 29-08-2005, 12:04 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,500,687.96997 seconds with 17 queries