Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: How can i Change Button Label Value Randomly in VIRTUAL KEYBOARD using JAVA/ VB/ NetBeans/ Dotnet ???

  1. #1
    Junior Member
    Join Date
    May 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How can i Change Button Label Value Randomly in VIRTUAL KEYBOARD using JAVA/ VB/ NetBeans/ Dotnet ???

    How can change Button Label value Every Time when i start Virtual Keyboard,
    Means ,if 1st time Button1=''a'' then next login time Button1 = " any Alphabet "...
    ....is this Possible through Probability Distribution & Counter...?


  2. #2
    Super Moderator pbrockway2's Avatar
    Join Date
    Jan 2012
    Posts
    987
    Thanks
    6
    Thanked 206 Times in 182 Posts

    Default Re: How can i Change Button Label Value Randomly in VIRTUAL KEYBOARD using JAVA/ VB/ NetBeans/ Dotnet ???

    I don't really know exactly what a "virtual keyboard" is and, less so, a "probability distribution and counter". But maybe this helps...

    It is possible to construct a List instance (an ArrayList, LinkedList, WhateverList) and fill it with 'a' to 'z'. That is put 26 chars into the list. Now you could also have a List of buttons so that the behaviour of button each button is linked to a specific element in the list of char values. Now the Collections class has a nice method shuffle() which can be used to shuffle the list of char values.

    So, for instance, the 3rd button will get its "value" from the 3rd element of the char list. When you click this button it might print 'c' to System.out. Then when the shuffle() method is called with the char list as an argument, the button behaviour will change and it will print some other random char value.

  3. #3
    Junior Member
    Join Date
    May 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How can i Change Button Label Value Randomly in VIRTUAL KEYBOARD using JAVA/ VB/ NetBeans/ Dotnet ???

    .
    ......Thnxxx.....someone give me same solution....i'try.

Similar Threads

  1. let an HTML button and textbox change a java parameter
    By marlon006 in forum Java Theory & Questions
    Replies: 7
    Last Post: February 26th, 2013, 04:15 PM
  2. Button does not change Background
    By Noob in forum AWT / Java Swing
    Replies: 6
    Last Post: November 16th, 2011, 01:34 PM
  3. Using a button to change the interface
    By kev670 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: March 16th, 2011, 08:59 PM
  4. Virtual Keyboard in Java
    By Brian in forum Java Theory & Questions
    Replies: 2
    Last Post: June 2nd, 2010, 11:35 PM
  5. how to using button to change linechart
    By NARs in forum AWT / Java Swing
    Replies: 3
    Last Post: October 30th, 2009, 12:53 PM