scrollbar - applet

scrollbar - applet

View Answers

October 15, 2008 at 11:56 AM

Hi friend,

I am sending running code.



import java.awt.*;
import java.applet.*;

public class ScrollbarDemo extends Applet {
Scrollbar scrollbar;
String s;

public void init() {
BorderLayout layout = new BorderLayout();
setLayout(layout);
scrollbar = new Scrollbar(Scrollbar.HORIZONTAL, 50, 0, 1, 100);
add("North", scrollbar);
s = "50";
Font font = new Font("TimesRoman", Font.BOLD, 72);
setFont(font);
resize(200, 200);
}

public void paint(Graphics g) {
g.drawString(s, 60, 120);
}

public boolean handleEvent(Event evt) {
if (evt.target instanceof Scrollbar){
scrollbar = (Scrollbar)evt.target;
int value = scrollbar.getValue();
s = String.valueOf(value);
repaint();
return true;
}
else{
boolean result = super.handleEvent(evt);
return result;
}
}
}

-----------------------
ScrollbarDemo.html

<HTML>
<BODY>
<div align = "center">
<APPLET CODE = "ScrollbarDemo.class" WIDTH = "400" HEIGHT = "200"></APPLET>
</div>
</BODY>
</HTML>

------------------------------------------------

Please visit for more information.

http://www.roseindia.net/java/example/java/applet/

Thanks









Related Tutorials/Questions & Answers:
scrollbar
scrollbar  I add a scrollbar to my Frame and its not working
Java Scrollbar
Java Scrollbar   What is the difference between a Scrollbar and a ScrollPane
Advertisements
vertical scrollbar but without a horizontal scrollbar
vertical scrollbar but without a horizontal scrollbar  How do I make a frame with a vertical scrollbar but without a horizontal scrollbar
Horizontal Scrollbar
Horizontal Scrollbar  How can I implement a horizontal scrollbar
Scrollbar
Scrollbar       A scrollbar is represented by a "slider" widget. The characteristics of it are specified by integer values which are being set at the time of scrollbar
frame with a vertical scrollbar but without a horizontal scrollbar.
frame with a vertical scrollbar but without a horizontal scrollbar.  How do I make a frame with a vertical scrollbar but without a horizontal scrollbar
Horizontal Scrollbar
Horizontal Scrollbar  I am creating a JSF project that has a print("<af:table/>"); the table is too wide to display in the browser. I was wondering if there was anyway to implement a horizontal scrollbar in this table so
scrollbar in JPanel
scrollbar in JPanel  Scroll bar is not working when i am using the panel layout is null. If i change the panel layout to flow or grid its working. I..., JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);f.add(s
menu with scrollbar
menu with scrollbar  I want to use MenuBar with Scrollbar. I tried it. I dont know how to do it. so please help me. The program should be.... 1.add JScrollPane into the panel. 2.Panel layout should be null. 3.Use menubar 4.Each
java program:scrollbar
java program:scrollbar  my program logic is that when i scrolling scrollbar according to that the oval shap is changed by fetching the value of scrollbar the oval is drawn please give me a proper code of this logic
CSS ScrollBar Properties
CSS ScrollBar Properties  How can i set ScrollBar properties in CSS? I am using HTML, CSS and Div in my code. Thanks!!   overflow: scroll; overflow-y: scroll; overflow-x: scroll; overflow:-moz-scrollbars-vertical
Scrollbar problem with struts <layout:collection>
Scrollbar problem with struts   How activate the vertical scrollbar in struts in mozilla firefox
div to scrollbar - Java Beginners
vertical scrollbar. for this i am using a css for that div in which i tried to add... who replied my answer.  hi, div and scrollbar html... ""; } function scrollBar(ownerID, ownerContentID, upID, dnID) { this.ownerID
how to add scrollbar to JFrame
how to add scrollbar to JFrame  hello friends i am making a java application in which i have a frame to which i wanted to add scrollbars but when... it shows the scrollbar but do not show the scrolling tabs here is my code pls do help
how to add scrollbar to JFrame
how to add scrollbar to JFrame  hello friends i am making a java application in which i have a frame to which i wanted to add scrollbars but when... it shows the scrollbar but do not show the scrolling tabs here is my code pls do help
how to add scrollbar to JFrame
how to add scrollbar to JFrame  hello friends i am making a java application in which i have a frame to which i wanted to add scrollbars but when... it shows the scrollbar but do not show the scrolling tabs here is my code pls do help
how to add scrollbar to JFrame
how to add scrollbar to JFrame  hello friends i am making a java application in which i have a frame to which i wanted to add scrollbars but when... it shows the scrollbar but do not show the scrolling tabs here is my code pls do help
how to add scrollbar to JFrame
how to add scrollbar to JFrame  hello friends i am making a java application in which i have a frame to which i wanted to add scrollbars but when... it shows the scrollbar but do not show the scrolling tabs here is my code pls do help
Visibal Certical scrollbar with struts collection layout.
Visibal Certical scrollbar with struts collection layout.  how to Visibal Vertical scroll bar with struts collection layout
dropdown to vert. scrollbar - Java Beginners
dropdown to vert. scrollbar  can u please help me how to change a dropdown into scrollbar when we resize th window in java script  Hi friend, drop down example var messages = new Array(6); messages[0
Scrollbar click in safari browser not Collapsing opened dropdowns
Scrollbar click in safari browser not Collapsing opened dropdowns  When im clicking on the scrollbar in safari browser the click not collapsing the opened dropdowns....i mean if iam scrolling the scrollbars after content is being
How set the height of Thumb in Vertical scrollbar..?
How set the height of Thumb in Vertical scrollbar..?  I have created a Vertical scrollbar. I have removed up arrow and down arrow. also i have changed the skin of thumb by including an image to it. I want the size of thumb same
Flex scrollbar control
Flex ScrollBar Control:- If the user handles data that are displayed but data is too much and not fit in the display area then the user use ScrollBar... the button depends on the current state of the ScrollBar controls. If user Example
How to Collapse Dropdowns on mouseclick on scrollbar in Safari Browser using javascript
How to Collapse Dropdowns on mouseclick on scrollbar in Safari Browser using javascript  How to Collapse Dropdowns on mouseclick on scrollbar in Safari Browser using javascript
in my project, i have to add only vertical scrollbar to a panel,but not horizontal scrollbar. i need some example on it,how to doit.
in my project, i have to add only vertical scrollbar to a panel,but not horizontal scrollbar. i need some example on it,how to doit.  in my project, i have to add only vertical scrollbar to a panel,but not horizontal scrollbar
Fix Scrollbar position in a checkboxList after postback
Fix Scrollbar position in a checkboxList after postback  Hi, I have a CheckBoxList in which have lot of items and i set AutoPostBack="True".I am using Scrollbar on this list.Now when I am checking any item then after postback
how i can add an horizontal scrollbar at my PdfAnnotation ? - JSP-Servlet
how i can add an horizontal scrollbar at my PdfAnnotation ?  How to add the an horizontal scrollbar at my PdfAnnotation ? for example document d=new document(0. document.open
java scrollbar
How to get Scrollbar value of textarea in html? - Design concepts & design patterns
How to get Scrollbar value of textarea in html?  Hi All, I have one registration page with terms & policy in read only textarea (Html input tag type). Requirement: Till user didn't scroll down textarea at the last line
how to add the scrollbar to the pdf page when generating the pdf file from jsp - JSP-Servlet
how to add the scrollbar to the pdf page when generating the pdf file from jsp  I am not able to see all the columns when i generated the pdf file from jsp.i have 12 colums so how to add the scrollbar
Create Scroll Bar in Java using SWT
a package org.eclipse.swt.widgets, which is used to create ScrollBar in Java..._SCROLL, SWT.H_SCROLL provided by the class ScrollBar creates the vertical...; }   shell.setText("Show Scrollbar");   
color change
color change  how to change the color in circle using scrollbar
Show the Value of Scroll Bar in Java Swing
components as like: scrollbar top arrow, scrollbar slider, scrollbar track and scrollbar bottom arrow. When you scroll the scrollbar with the help of these components then you get the value of scrolling positions. This program shows a scrollbar
JScrollBar - Java Beginners
java.awt.event.*; import javax.swing.*; public class IMPL_ScrollBar implements...; JLabel lb1; public IMPL_ScrollBar() { frame = new JFrame("This is a scrollbar...("Hello"); } public static void main(String[] args) { IMPL_ScrollBar sb
problem Scrolling jTable in scrollpane
(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); pane.setSize
problem Scrolling jTable in scrollpane
(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); pane.setSize
problem scrolling jtable
); pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED..._SCROLLBAR_ALWAYS); pane.getVerticalScrollBar().setUnitIncrement(10
Lost Using Swing Components(2)
JScrollPane(message, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); panel3.add(scroll); //Insert
java GUI program - Java Beginners
, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS
scrollableDataTable Related issue
. And in xhtml, I have used following code <div id="scrollbar" style="overflow
Lost Using Swing Components(3)
, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS
Lost Using Swing Components
, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS
Lost Using Swing Components
, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS
Lost Using Swing Components
, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); panel3.add(scroll); //Insert missing code here
Java Interview Questions - Page 11
Question: What is the difference between a Scrollbar and a ScrollPane? Answer: A Scrollbar is a Component, but not a Container. A ScrollPane
Core Java Interview Question, Interview Question
is the difference between a Scrollbar and a ScrollPane? Answer: A Scrollbar is a Component
JTable Pagination
(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS); jScrollPane3.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS
Flex 4 Features
ButtonBar ScrollBar CheckBox ComboBox RadioButton TextInput
jQuery UI Widget : Dialog
height, a scrollbar will automatically appear.ADS_TO_REPLACE_1
Displaying the same image in a JPanel and using scroll - HELP - Java Beginners
(drawingPane, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR

Ads