| | |
help on whiteboard player
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jun 2007
Posts: 8
Reputation:
Solved Threads: 0
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 )
[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]
Code: ( text )
- <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] } - [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.
•
•
Join Date: Jun 2007
Posts: 8
Reputation:
Solved Threads: 0
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..
[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]
Java Syntax (Toggle Plain Text)
import javax.swing.*; import javax.swing.event.*; import java.awt.*; public class ScrollSlider { public static void main(String args[]) { JFrame f = new JFrame("Change Slider"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JSlider aJSlider = new JSlider (JSlider.HORIZONTAL, 0, 1000, 500); ChangeListener aChangeListener = new BoundedChangeListener(); aJSlider.addChangeListener(aChangeListener); Container c = f.getContentPane(); c.add (aJSlider, BorderLayout.SOUTH); f.setSize (300, 200); f.setVisible (true); } } class BoundedChangeListener implements ChangeListener { public void stateChanged(ChangeEvent changeEvent) { Object source = changeEvent.getSource(); if (source instanceof BoundedRangeModel) { BoundedRangeModel aModel = (BoundedRangeModel) source; if (!aModel.getValueIsAdjusting()) { System.out.println("Changed: " + aModel.getValue()); } } else if (source instanceof JSlider) { JSlider theJSlider = (JSlider) source; if (!theJSlider.getValueIsAdjusting()) { System.out.println("Slider changed: " + theJSlider.getValue()); } } else if (source instanceof JProgressBar) { JProgressBar theJProgressBar = (JProgressBar) source; System.out.println("ProgressBar changed: " + theJProgressBar.getValue()); } else { System.out.println("Something changed: " + source); } } }
[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]
![]() |
Similar Threads
- media player f**k-up (Windows NT / 2000 / XP)
- Windows Media Player 7.1 (Windows 95 / 98 / Me)
- Windows media player (Windows NT / 2000 / XP)
Other Threads in the Java Forum
- Previous Thread: Google API in Web Services Application
- Next Thread: please help me
Views: 528 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for Java
-xlint android animated api apple applet application arguments array arrays automation binary blackberry block bluetooth chat class classes client code component database developmenthelp draw eclipse encode error event exception file fractal game gameprogramming givemetehcodez graphics gui helpwithhomework html ide image input integer iphone j2me j2seprojects java javac javaprojects jmf jni jpanel julia lego linux list loop loops mac map method methods mobile netbeans newbie notdisplaying number object online oracle print problem program programming project recursion scanner screen server set singleton size sms socket sort sql string swing system template test textfields threads time title transfer tree tutorial-sample update windows working






