Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Applet scrollbar - applet
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


krishna
scrollbar - applet
1 Answer(s)      6 years and 2 months ago
Posted in : Applet



Advertisement
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
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
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
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
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
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 provided by the class ScrollBar creates the vertical and horizontal bars...; shell.setText("Show Scrollbar");   shell.open
color change
color change  how to change the color in circle using scrollbar
 

 

 

DMCA.com