help on whiteboard player

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jun 2007
Posts: 8
Reputation: dotcom123 is an unknown quantity at this point 
Solved Threads: 0
dotcom123 dotcom123 is offline Offline
Newbie Poster

help on whiteboard player

 
0
  #1
Jul 9th, 2007
I have the slider code and the paragraph im going to put inside.That is create a horizontal slider bar, that will display individual words, each weight along the slider. So, at each step of the slider,a different words is displayed..so i need to load it up to the website using java applet..Thank you for your time and attention..



Code: ( text )
  1. <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace]import javax.swing.*;
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace]import javax.swing.event.*;
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace]import java.awt.*;
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace]
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace]public class ScrollSlider {
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] public static void main(String args[]) {
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] JFrame f = new JFrame("Change Slider");
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace]
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] JSlider aJSlider = new JSlider (JSlider.HORIZONTAL, 0, 1000, 500);
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] ChangeListener aChangeListener = new BoundedChangeListener();
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] aJSlider.addChangeListener(aChangeListener);
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] Container c = f.getContentPane();
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] c.add (aJSlider, BorderLayout.SOUTH);
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] f.setSize (300, 200);
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] f.setVisible (true);
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] }
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace]}
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace]class BoundedChangeListener implements ChangeListener {
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] public void stateChanged(ChangeEvent changeEvent) {
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] Object source = changeEvent.getSource();
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] if (source instanceof BoundedRangeModel) {
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] BoundedRangeModel aModel = (BoundedRangeModel) source;
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] if (!aModel.getValueIsAdjusting()) {
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] System.out.println("Changed: " + aModel.getValue());
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] }
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] } else if (source instanceof JSlider) {
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] JSlider theJSlider = (JSlider) source;
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] if (!theJSlider.getValueIsAdjusting()) {
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] System.out.println("Slider changed: " + theJSlider.getValue());
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] }
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] } else if (source instanceof JProgressBar) {
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] JProgressBar theJProgressBar = (JProgressBar) source;
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] System.out.println("ProgressBar changed: "
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] + theJProgressBar.getValue());
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] } else {
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] System.out.println("Something changed: " + source);
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] }
    <LI style="FONT-SIZE: 8pt; BACKGROUND: #fcfcfc">[FONT='Courier New', Courier, monospace] }
  2. [FONT='Courier New', Courier, monospace]}




[Paragraph]
Java is inevitably something you have heard a lot about, but may not have heard anything very informative about. What is it, and what can it do for you? Java is a programming language created Sun Microsystems, a designer of high end computer work stations. Java is designed to be extremely robust, to work across networks, and to work across all computer platforms. Because of the cross platform abilities and the time it was created, Java is often thought of as a natural for the internet. All this has made it the darling of the computing world. Plans are currently being made to develop many of the next decades computer applications in Java.

[/Paragraph]
Last edited by dotcom123; Jul 9th, 2007 at 6:01 am.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,653
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1500
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: help on whiteboard player

 
0
  #2
Jul 9th, 2007
Any reason for posting all this nonsense code ?
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 8
Reputation: dotcom123 is an unknown quantity at this point 
Solved Threads: 0
dotcom123 dotcom123 is offline Offline
Newbie Poster

Re: help on whiteboard player

 
0
  #3
Jul 9th, 2007
I have the slider code and the paragraph im going to put inside.That is create a horizontal slider bar, that will display individual words, each weight along the slider. So, at each step of the slider,a different words is displayed..so i need to load it up to the website using java applet..Thank you for your time and attention..

  1. import javax.swing.*;
  2. import javax.swing.event.*;
  3. import java.awt.*;
  4.  
  5. public class ScrollSlider {
  6. public static void main(String args[]) {
  7. JFrame f = new JFrame("Change Slider");
  8. f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  9.  
  10. JSlider aJSlider = new JSlider (JSlider.HORIZONTAL, 0, 1000, 500);
  11. ChangeListener aChangeListener = new BoundedChangeListener();
  12. aJSlider.addChangeListener(aChangeListener);
  13. Container c = f.getContentPane();
  14. c.add (aJSlider, BorderLayout.SOUTH);
  15. f.setSize (300, 200);
  16. f.setVisible (true);
  17. }
  18. }
  19. class BoundedChangeListener implements ChangeListener {
  20. public void stateChanged(ChangeEvent changeEvent) {
  21. Object source = changeEvent.getSource();
  22. if (source instanceof BoundedRangeModel) {
  23. BoundedRangeModel aModel = (BoundedRangeModel) source;
  24. if (!aModel.getValueIsAdjusting()) {
  25. System.out.println("Changed: " + aModel.getValue());
  26. }
  27. } else if (source instanceof JSlider) {
  28. JSlider theJSlider = (JSlider) source;
  29. if (!theJSlider.getValueIsAdjusting()) {
  30. System.out.println("Slider changed: " + theJSlider.getValue());
  31. }
  32. } else if (source instanceof JProgressBar) {
  33. JProgressBar theJProgressBar = (JProgressBar) source;
  34. System.out.println("ProgressBar changed: "
  35. + theJProgressBar.getValue());
  36. } else {
  37. System.out.println("Something changed: " + source);
  38. }
  39. }
  40. }

[Paragraph]
Java is inevitably something you have heard a lot about, but may not have heard anything very informative about. What is it, and what can it do for you? Java is a programming language created Sun Microsystems, a designer of high end computer work stations. Java is designed to be extremely robust, to work across networks, and to work across all computer platforms. Because of the cross platform abilities and the time it was created, Java is often thought of as a natural for the internet. All this has made it the darling of the computing world. Plans are currently being made to develop many of the next decades computer applications in Java.

[/Paragraph]
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Java Forum


Views: 528 | Replies: 2
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC