HELP - scrollbar
Hi,
I have a problem with an overlay: I can’t apply the scrollbar on buttons.
I can apply a scrollbar for a group picture. However, the touch user will roll continue all images.
I'd like to just scroll to the next image, from image to image.
How can I do it on DPS? I saw this effect on WoodWing.
Best Regards,
Your question is not clear at all. It’s obvious that English is not your native language so either find someone with a stronger command of English or post in your native language and we’ll see if we can figure it out that way.
Bob
Similar Messages
-
Closing the browser after logout
Version 1.6
We're using Internet Explorer and I need to close the browser after/when the user clicks on the Logout link. How can I accomplish this?
Thanks,
JoeThe online help for the onClick Javascript field says
"In the link generated for this icon include the following onClick javascript. Use of the onclick javascript could popup a help page in a new window (see example 1).
Example 1:
window.open('US/asfhhome.htm','Help','scrollbars=yes,resizable=yes,width=625,height=350,left=25,top=150');return false
Set the Icon Target attribute to # if you are using OnClick JavaScript. Set the Image Alt Text attribute to the text the user will see to click on."So, try putting "#" in the Target and window.close() in the onClick Javascript box.
Message was edited by:
Vikas -
In a report, select the column which can link to a query information
Hi,
I want to open a report in which there is a column, say, Name, when I click it
I can view the other information about this Name, say, address or contact telephone no.
Regards,
Simon WongHi,
1. Go to any report with link column to a form. It is a very common situation.
2. Go to the link column Column Attributes/Column Link/Target and change it to URL.
3. javascript:popupURL('f?p=&APP_ID.:205:&SESSION.::&DEBUG.::::YES','Help','scrollbars=yes,resizable=yes,width=625,height=350,left=25,top=150');
4. Replace 205 (It is my page number) with the number of the page which you are working on.
5. Apply/Apply/Run the page.
6. You should see the printer friendly version of your page in separate window without loosing original one.
This is a very simple, easy to use and understand example.
You can replace “205” with any report showing Address … for the client.
Good luck!
Konstantin
[email protected] -
How to open a new browser window from a link on the navigation bar
Hi,
I entered a URL in the 'URL Target' field for the Navigation Bar Entry. As expected when the I clicked on the link in the Navigation Bar my browser refreshed with the target URL.
I want to be able to actually open a new window rather than refresh my current window. The help text says, and I quote ...
"In the link generated for this icon include the following onClick javascript. Use of the onclick javascript could popup a help page in a new window (see example 1).
Example 1:
window.open('US/asfhhome.htm','Help','scrollbars=yes,resizable=yes,width=625,height=350,left=25,top=150');return false
Set the Icon Target attribute to # if you are using OnClick JavaScript. Set the Image Alt Text attribute to the text the user will see to click on."
So I created similar Javascript as to the example and placed in the 'OnClick Javascript' field, and placed a '#' in the 'URL Target' field.
When I run it doesn't work, the '#' is picked up and the Javascript is ignored. Can somebody please tell me what I'm doing wrong.
ThanksI had the same problem. I finally ended up just using the standard popupURL javascript. In the URL Target I have:
javascript:popupURL('<link>')
This opens a new window but since it is for popups the menus are missing. You may want to write your own javascript function to open the new window with your own settings.
Search the forums for popupURL for more ideas.
javascript:popupURL()
--Jeff -
Report field substibution on URL Redirect
I am using ApEx 2.0
I have a page with two report regions based on SQL queries, joined by a common column. The master region is read only and in detail region, I changed the attribute of one field to display as text.
So, for example, the Master region has two columns:
M_COL1, M_COL2
The detail region has 3 columns:
M_COL1, D_COL1, D_COL2
The regions as joined on M_COL1 and D_COL2 is the Text field.
Next, i added a button to this detail region. When clicked I want this button to launch a URL whose parameters are sourced from some of the existing report column/fields on this page.
I cannot seem to get the substitution to work in the URL Redirect field of the button definition.
I want something to the effect of :
http://someserver:port/some_path/something?param1=&M_COL1¶m2=&D_COL2
I tried putting #M_COL1#, :M_COL1 etc. but it doesn't work.
Any ideas/pointers?
Thanks,
ManishHi,
5. Pop-up reports:
- Go to any report with link column to a form. It is a very common situation.
- Go to the link column Column Attributes/Column Link/Target and change it to URL.
- javascript: popupURL('f?p=&APP_ID.:205:&SESSION.::&DEBUG.::::YES','Help','scrollbars=yes,resizable=yes,width=625,height=350,left=25,top=150');
- Replace 205 (It is my page number) with the number of the page which you are working on.
- Apply/Apply/Run the page.
- One would see the printer friendly version of ones page in separate window without loosing original one.
This is a very simple, easy to use and understand example.
One can replace “205” with any report showing Address … for the client.
6. One Master and many Detail tables:
Suppose that there are relations One to Many between one master and two or more details tables.
One can use two regions on a page. One should be a form region for the master table and second one should be a report region with several links.
6.1. Create a view of those two or more details tables. That is one master and one details view.
6.2. Create a Master Details form. The details form should be one of details tables.
6.3. Go to Edit Region (Details Region) and change SQL Query (updatable query) to SQL Query.
The Details form became Details Report.
6.4. Change Report Region Source from details table query to the view query.
6.5. Duplicate columns which are links and reorder them. Replace their header names with “ ” for instance.
6.6. Into Column Attributes/Column Link/Link Text pick an icon.
6.7. Select for Attributes/Column Link/Target “URL”.
6.8. Into URL field type
javascript: popupURL('f?p=&APP_ID.:205:&SESSION.::&DEBUG.::::NO','Link','scrollbars=yes,resizable=yes,width=625,height=350,left=25,top=150');
and replace 205 with the appropriate page number.
Now the page has one form with Next and Previous buttons for the master table and one report for the Details view with two or more links. Pop-up window with an edit detail table form appears when one click on a link (icon).
Konstantin Gudjev
[email protected] -
Closing seperate browser after cfcontent
Hi all,
I would like to get some help on cfcontent.
I use cfcontent to open a pdf in a seperate browser,
which works.I have a close button on the parent
window, along with other information related to the document.
When I hit the close button, I would like the pdf
browser(window)
to close. It doesn't seem to recognize that the PDFImage
window is open.
Below is my code to display the image
<cfheader name="Content-Disposition"
value="#URL.Image#">
<cfcontent type="application/pdf" file="#URL.Image#">
//Code to close the image window in the parent window close
button.
function closepage(){
//one way
if (window.PDFImage && window.PDFImage.open
&& !window.PDFImage.closed){
window.PDFImage.close();
//other way
if (PDFImage != null && PDFImage.open){
PDFImage.close();
The next issue is, I am trying to display a jpg in a
<table, the image must
be within the table. It works when I have the <img tag,
but I Would
like to replace it, due to some sharing violation of the
image being displayed.
cfcontent seems to work, but it takes the whole browser,
other codes(like buttons)
are ignored.
<table align="left" cellpadding="0" cellspacing="0"
class="withborder">
<tr> <td><span id="List3">
<cfheader name="Content-Disposition"
value="#Form.image_file#">
<cfcontent type="image/jpeg" file="#Form.image_file#">
<!---<img border="2" id="img1" src="#Form.image_file#"
width="250">--->
</span></td>
</tr>
</table>
I am using MX 7. Any suggestions/solutions are welcome.
Thanks all for your time.The online help for the onClick Javascript field says
"In the link generated for this icon include the following onClick javascript. Use of the onclick javascript could popup a help page in a new window (see example 1).
Example 1:
window.open('US/asfhhome.htm','Help','scrollbars=yes,resizable=yes,width=625,height=350,left=25,top=150');return false
Set the Icon Target attribute to # if you are using OnClick JavaScript. Set the Image Alt Text attribute to the text the user will see to click on."So, try putting "#" in the Target and window.close() in the onClick Javascript box.
Message was edited by:
Vikas -
Help Needed With Scrollbar and Content
I'm having a difficult time with the Scrollbar component. I'm trying to have a scrollbar set up to navigate a text field or a MC of a text field. I managed to get it functioning within the desired frame, however when I jump to another frame, that very same content appears on the other frame, despite the fact that said frame did not have the scrollbar nor the content pasted within.
The bar seems to do what I want it to do save for the unwelcomed presence outside of the frame of choice. Here's the code I'm using. This is the keyframe code:
import boppreh.ui.Scrollbar
var scrollbar1:Scrollbar = new Scrollbar(boomboom, 500, true, false, 293, bar, slider, arrowUp, arrowDown)
addChild(scrollbar1)
scrollbar1.x = 50
scrollbar1.y = 50
And this is the code found in the AS file:
package boppreh.ui
import flash.display.*
import flash.events.*
import flash.geom.Rectangle;
import flash.utils.Timer
import flash.ui.Keyboard
* Scrollbar to handle single display objects.
* Author: Lucas Boppre Niehues ([email protected])
* Date: 09/02/2010
public class Scrollbar extends Sprite {
/// The default width for the default slider, bar and arrows, as well as the default arrows' height
public static const DEFAULT_SIDE:Number = 20
/// The delay (in milliseconds) between clicking and holding an arrow and the slider moving continously
public static var SCROLL_DELAY:Number = 300
/// The number of lines to be scrolled every second during continous scrolling
public static var LINES_PER_SECOND:Number = 1.5
/// Number of pixels to be scrolled for each mouse wheel line (default lines per wheel tick is 3)
public static var PIXELS_PER_LINE:Number = 16
protected var windowSize:Number
protected var contentPadding:Number
protected var isVertical:Boolean
/// Stored movement to be applied on the next "scroll()" call
protected var movement:Number
/// Timer used to control the delay before continous scrolling
protected var timer:Timer
protected var content:DisplayObject
protected var contentBounds:Rectangle
protected var bar:InteractiveObject
protected var arrowUp:InteractiveObject
protected var arrowDown:InteractiveObject
protected var slider:InteractiveObject
protected var partHold:InteractiveObject
protected function get eventOrigin():String {
if (partHold == arrowUp)
return ScrollEvent.ARROW_UP
else if (partHold == arrowDown)
return ScrollEvent.ARROW_DOWN
else if (partHold == bar)
return ScrollEvent.BAR
throw new Error("Unkown event origin.")
private var mouseOffset:Number
protected function get maxContentPos():Number {
if (isVertical)
return -(contentBounds.height - windowSize) - 1
else
return -(contentBounds.width - windowSize) - 1
/// The content's current position, in a scale from 0 to 1
public function get position():Number {
if (isVertical)
return contentBounds.y / maxContentPos
else
return contentBounds.x / maxContentPos
public function set position(value:Number) {
value = Math.min(1, Math.max(value, 0))
var newContentPos:Number = value * maxContentPos
setPosition(content, isVertical ? null : newContentPos, isVertical ? newContentPos : null, false, false)
contentBounds = content.getBounds(this)
if (isVertical) {
bar.height = windowSize - (arrowUp.height + arrowDown.height)
slider.height = (windowSize / Math.max(contentBounds.height, windowSize)) * bar.height
var newSliderY:Number = arrowUp.height + (-newContentPos / contentBounds.height) * bar.height
setPosition(slider, null, newSliderY, false, false)
} else {
bar.width = windowSize - (arrowUp.width + arrowDown.width)
slider.width = (windowSize / Math.max(contentBounds.width, windowSize)) * bar.width
var newSliderX:Number = arrowUp.width + (-newContentPos / contentBounds.width) * bar.width
setPosition(slider, newSliderX, null, false, false)
updatePartsPositions()
* Creates a new Scrollbar object to scroll a single Display Object.
* @param content the object to be scrolled
* @param windowSize the height or width of the scrollbar, depending if it's vertical or not; i.e.: the dimension of the content's visible part
* @param isVertical defines if the scrollbar's parts should be placed on the right or bottom of the content, and if the content should be scrolled upways or to the right
* @param autoUpdate automatically checks for dimensions changes in any part and updates accordingly. Use only if the content will be resized
* @param contentPadding the distance between the content and all the other parts
* @param bar the bar object to be used; if null, a default one will be used
* @param slider the slider object to be used; if null, a default one will be used
* @param arrowUp the arrow up/left object to be used; if null, a default one will be used
* @param arrowDown the arrow down/right object to be used; if null, a default one will be used
public function Scrollbar(content:DisplayObject, windowSize:Number, isVertical:Boolean=true, autoUpdate:Boolean=false, contentPadding:Number=5, bar:InteractiveObject=null, slider:InteractiveObject=null, arrowUp:InteractiveObject=null, arrowDown:InteractiveObject=null) {
this.content = content
this.windowSize = windowSize
this.contentPadding = contentPadding
this.isVertical = isVertical
this.bar = bar || createDefaultBar()
this.arrowUp = arrowUp || createDefaultArrow(false)
this.arrowDown = arrowDown || createDefaultArrow(true)
this.slider = slider || createDefaultSlider()
timer = new Timer(SCROLL_DELAY)
timer.addEventListener(TimerEvent.TIMER, startScrolling)
addParts()
if (autoUpdate)
this.addEventListener(Event.ENTER_FRAME, update)
configureListeners()
update()
position = 0
protected function scroll(e:*= null):void {
// This nested if forbids the slider to continue moving if the user is
// "holding" the bar and the slider already reached the mouse position
if (e && (e is Event) && (Event(e).type == Event.ENTER_FRAME)) {
if (partHold == bar) {
var sliderBounds:Rectangle = slider.getBounds(this)
if (isVertical) {
if (mouseY > sliderBounds.top && mouseY < sliderBounds.bottom) {
stopScrolling()
return
} else {
if (mouseX > sliderBounds.left && mouseX < sliderBounds.right) {
stopScrolling()
return
scrollPixels(movement)
* Scrolls the content by the specified ammount.
* @param number number of pixels to be scrolled
protected function scrollPixels(number:Number):void {
position += number / -maxContentPos
protected function configureListeners():void {
slider.addEventListener(MouseEvent.MOUSE_DOWN, startSliderDrag)
for each (var part:InteractiveObject in [arrowUp, arrowDown, bar]) {
part.addEventListener(MouseEvent.MOUSE_DOWN, fixedPart_onMouseDownHandler)
addEventListener(MouseEvent.MOUSE_WHEEL, mouse_onWheelScrollHandler)
addEventListener(KeyboardEvent.KEY_DOWN, keyboard_onKeyDownHandler)
protected function fixedPart_onMouseDownHandler(event:MouseEvent):void
partHold = InteractiveObject(event.currentTarget)
if (partHold == arrowUp) {
movement = -PIXELS_PER_LINE
} else if (partHold == arrowDown) {
movement = PIXELS_PER_LINE
} else if (partHold == bar) {
var sliderBounds:Rectangle = slider.getBounds(this)
if (isVertical) {
if (mouseY > (sliderBounds.top + sliderBounds.height / 2))
movement = windowSize
else
movement = -windowSize
} else {
if (mouseX > (sliderBounds.left + sliderBounds.width / 2))
movement = windowSize
else
movement = -windowSize
scroll()
dispatchEvent(new ScrollEvent(ScrollEvent.SCROLL, eventOrigin))
stage.addEventListener(MouseEvent.MOUSE_UP, stopScrolling)
partHold.addEventListener(MouseEvent.MOUSE_OUT, stopScrolling)
timer.start()
protected function keyboard_onKeyDownHandler(event:KeyboardEvent):void {
switch (event.keyCode) {
case Keyboard.UP:
case Keyboard.LEFT:
movement = -PIXELS_PER_LINE
break
case Keyboard.DOWN:
case Keyboard.RIGHT:
movement = PIXELS_PER_LINE
break
case Keyboard.SPACE:
case Keyboard.PAGE_DOWN:
movement = windowSize
break
case Keyboard.PAGE_UP:
movement = -windowSize
break
case Keyboard.HOME:
movement = 0
position = 0
break
case Keyboard.END:
movement = 0
position = 100
break
default:
return
scroll()
dispatchEvent(new ScrollEvent(ScrollEvent.SCROLL, ScrollEvent.KEYBOARD))
protected function startScrolling(e:*=null):void {
timer.reset()
this.addEventListener(Event.ENTER_FRAME, scroll)
movement = (movement * (LINES_PER_SECOND * PIXELS_PER_LINE)) / stage.frameRate
dispatchEvent(new ScrollEvent(ScrollEvent.CONTINOUS_SCROLL_START, eventOrigin))
protected function stopScrolling(e:*=null) {
timer.stop()
this.removeEventListener(Event.ENTER_FRAME, scroll)
stage.removeEventListener(KeyboardEvent.KEY_UP, stopScrolling)
stage.removeEventListener(MouseEvent.MOUSE_UP, stopScrolling)
dispatchEvent(new ScrollEvent(ScrollEvent.CONTINOUS_SCROLL_STOP, eventOrigin))
if (partHold) {
partHold.removeEventListener(MouseEvent.MOUSE_OUT, stopScrolling)
partHold = null
protected function mouse_onWheelScrollHandler(event:MouseEvent) {
// The mouse wheel delta arrives inverted
var delta:int = -event.delta
movement = delta * PIXELS_PER_LINE
scroll()
dispatchEvent(new ScrollEvent(ScrollEvent.SCROLL, ScrollEvent.MOUSE_WHEEL))
//{ region Slider Drag functions
protected function startSliderDrag(event:MouseEvent) {
if (isVertical)
mouseOffset = slider.getBounds(this).y - this.mouseY
else
mouseOffset = slider.getBounds(this).x - this.mouseX
stage.addEventListener(MouseEvent.MOUSE_MOVE, onSliderDrag)
stage.addEventListener(MouseEvent.MOUSE_UP, stopSliderDrag)
dispatchEvent(new ScrollEvent(ScrollEvent.SLIDER_DRAG_START, ScrollEvent.SLIDER))
protected function stopSliderDrag(event:MouseEvent) {
stage.removeEventListener(MouseEvent.MOUSE_UP, stopSliderDrag)
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onSliderDrag)
dispatchEvent(new ScrollEvent(ScrollEvent.SLIDER_DRAG_STOP, ScrollEvent.SLIDER))
protected function onSliderDrag(event:MouseEvent) {
if (isVertical) {
if (bar.height == slider.height)
return
} else {
if (bar.width == slider.width)
return
if (isVertical)
position = (this.mouseY + mouseOffset - arrowUp.height) / (bar.height - slider.height)
else
position = (this.mouseX + mouseOffset - arrowUp.width) / (bar.width - slider.width)
//} endregion
//{ region Visual functions
/// Adds all required parts to the scrollbar's display list
protected function addParts():void {
setPosition(content, 0, 0, false, false)
addChild(this.bar)
addChild(this.arrowUp)
addChild(this.arrowDown)
addChild(this.slider)
addChild(this.content)
* Updates all parts to fit the new dimensions and positions.
public function update(e:*= null):void {
contentBounds = content.getBounds(this)
updatePartsPositions()
// Ugly, but updates everything that was not update in the above call based on the content's position and size
position = position
protected function updatePartsPositions(event:Event = null):void {
if (isVertical) {
// The parts width is divided by 2 because they will be center aligned
var newX:Number = contentBounds.width +
contentPadding +
Math.max(slider.width, arrowUp.width, arrowDown.width, bar.width) / 2
setPosition(arrowUp, newX, 0, true, false)
setPosition(bar, newX, arrowUp.height, true, false)
setPosition(arrowDown, newX, arrowUp.height + bar.height, true, false)
setPosition(slider, newX, null, true, false)
} else {
var newY:Number = contentBounds.height +
contentPadding +
Math.max(slider.height, arrowUp.height, arrowDown.height, bar.height) / 2
setPosition(arrowUp, 0, newY, false, true)
setPosition(bar, arrowUp.width, newY, false, true)
setPosition(arrowDown, arrowUp.width + bar.width, newY, false, true)
setPosition(slider, null, newY, false, true)
updateMask()
private function updateMask():void {
if (content.mask && this.contains(content.mask))
removeChild(content.mask)
var contentMask:Sprite = createWindowMask()
addChild(contentMask)
content.mask = contentMask
protected function setPosition(part:DisplayObject, newX:Object=null, newY:Object=null, alignHorizontal:Boolean=false, alignVertical:Boolean=false):void {
var bounds:Rectangle = part.getBounds(this)
if (newX is Number)
part.x = int(newX) + (part.x - bounds.x) - ((alignHorizontal) ? bounds.width / 2 : 0)
if (newY is Number)
part.y = int(newY) + (part.y - bounds.y) - ((alignVertical) ? bounds.height / 2 : 0)
//} endregion
//{ region Functions to draw parts
private function createDefaultBar():Sprite {
var image:Sprite = new Sprite()
image.graphics.lineStyle(1)
image.graphics.beginFill(0xFFFFFF)
if (isVertical)
image.graphics.drawRect(0, 0, DEFAULT_SIDE, windowSize - DEFAULT_SIDE * 2)
else
image.graphics.drawRect(0, 0, windowSize - DEFAULT_SIDE * 2, DEFAULT_SIDE)
image.graphics.endFill()
//image.buttonMode = true
return image
private function createDefaultArrow(inverted:Boolean):Sprite {
var image:Sprite = new Sprite()
image.graphics.lineStyle(1)
image.graphics.beginFill(0xBFBFBF)
image.graphics.drawRect(0, 0, DEFAULT_SIDE, DEFAULT_SIDE)
image.graphics.endFill()
image.graphics.lineStyle(3)
if (isVertical) {
if (inverted) {
image.graphics.moveTo(4, 4)
image.graphics.lineTo(10, 16)
image.graphics.lineTo(16, 4)
} else {
image.graphics.moveTo(4, 16)
image.graphics.lineTo(10, 4)
image.graphics.lineTo(16, 16)
} else {
if (inverted) {
image.graphics.moveTo(4, 4)
image.graphics.lineTo(16, 10)
image.graphics.lineTo(4, 16)
} else {
image.graphics.moveTo(16, 4)
image.graphics.lineTo(4, 10)
image.graphics.lineTo(16, 16)
image.buttonMode = true
return image
private function createDefaultSlider():Sprite {
var image:Sprite = new Sprite()
image.graphics.lineStyle(1)
image.graphics.beginFill(0xBFBFBF)
if (isVertical)
image.graphics.drawRect(0, 0, DEFAULT_SIDE, windowSize - DEFAULT_SIDE * 2)
else
image.graphics.drawRect(0, 0, windowSize - DEFAULT_SIDE * 2, DEFAULT_SIDE)
image.graphics.endFill()
image.buttonMode = true
return image
private function createWindowMask():Sprite {
var image:Sprite = new Sprite()
image.graphics.lineStyle(0)
image.graphics.beginFill(0x000000, 1)
if (isVertical)
image.graphics.drawRect(0, 0, content.width + 1, windowSize)
else
image.graphics.drawRect(0, 0, windowSize, content.width + 1)
image.graphics.endFill()
image.alpha = 0
return image
//} endregion
And this is the ScrollEvent AS file:
package boppreh.ui
import flash.events.Event;
* Events related to the Scrollbar class.
* Author: Lucas Boppre Niehues ([email protected])
* Date: 09/02/2010
public class ScrollEvent extends Event
/// Dispatched when a scroll movement occurs
public static const SCROLL:String = "scroll"
/// Dispatched when the user has clicked and is holding an arrow or the bar
public static const CONTINOUS_SCROLL_START:String = "continous scroll start"
/// Dispatched when the user has clicked and dropped an arrow or the bar
public static const CONTINOUS_SCROLL_STOP:String = "continous scroll stop"
/// Dispatched when the user starts dragging the slider part
public static const SLIDER_DRAG_START:String = "slider drag start"
/// Dispatched when the user stops dragging the slider part
public static const SLIDER_DRAG_STOP:String = "slider drag stop"
/// Origin type representing the arrow up part
public static const ARROW_UP:String = "arrow up"
/// Origin type representing the arrow down part
public static const ARROW_DOWN:String = "arrow down"
/// Origin type representing the bar part
public static const BAR:String = "part"
/// Origin type representing the slider part
public static const SLIDER:String = "slider"
/// Origin type representing the keyboard
public static const KEYBOARD:String = "keyboard"
/// Origin type representing the mouse wheel
public static const MOUSE_WHEEL:String = "mouse wheel"
public var origin:String
* Creates a new ScrollEvent object.
* @param type the object type (first group of declared constants)
* @param origin the object that originated the event (second group of declared constants)
public function ScrollEvent (type:String, origin:String, bubbles:Boolean = false, cancelable:Boolean = false) {
this.origin = origin
super(type, bubbles, cancelable)
Any help would be appreciated. I've been stuck here all day.I'm having a difficult time with the Scrollbar component. I'm trying to have a scrollbar set up to navigate a text field or a MC of a text field. I managed to get it functioning within the desired frame, however when I jump to another frame, that very same content appears on the other frame, despite the fact that said frame did not have the scrollbar nor the content pasted within.
The bar seems to do what I want it to do save for the unwelcomed presence outside of the frame of choice. Here's the code I'm using. This is the keyframe code:
import boppreh.ui.Scrollbar
var scrollbar1:Scrollbar = new Scrollbar(boomboom, 500, true, false, 293, bar, slider, arrowUp, arrowDown)
addChild(scrollbar1)
scrollbar1.x = 50
scrollbar1.y = 50
And this is the code found in the AS file:
package boppreh.ui
import flash.display.*
import flash.events.*
import flash.geom.Rectangle;
import flash.utils.Timer
import flash.ui.Keyboard
* Scrollbar to handle single display objects.
* Author: Lucas Boppre Niehues ([email protected])
* Date: 09/02/2010
public class Scrollbar extends Sprite {
/// The default width for the default slider, bar and arrows, as well as the default arrows' height
public static const DEFAULT_SIDE:Number = 20
/// The delay (in milliseconds) between clicking and holding an arrow and the slider moving continously
public static var SCROLL_DELAY:Number = 300
/// The number of lines to be scrolled every second during continous scrolling
public static var LINES_PER_SECOND:Number = 1.5
/// Number of pixels to be scrolled for each mouse wheel line (default lines per wheel tick is 3)
public static var PIXELS_PER_LINE:Number = 16
protected var windowSize:Number
protected var contentPadding:Number
protected var isVertical:Boolean
/// Stored movement to be applied on the next "scroll()" call
protected var movement:Number
/// Timer used to control the delay before continous scrolling
protected var timer:Timer
protected var content:DisplayObject
protected var contentBounds:Rectangle
protected var bar:InteractiveObject
protected var arrowUp:InteractiveObject
protected var arrowDown:InteractiveObject
protected var slider:InteractiveObject
protected var partHold:InteractiveObject
protected function get eventOrigin():String {
if (partHold == arrowUp)
return ScrollEvent.ARROW_UP
else if (partHold == arrowDown)
return ScrollEvent.ARROW_DOWN
else if (partHold == bar)
return ScrollEvent.BAR
throw new Error("Unkown event origin.")
private var mouseOffset:Number
protected function get maxContentPos():Number {
if (isVertical)
return -(contentBounds.height - windowSize) - 1
else
return -(contentBounds.width - windowSize) - 1
/// The content's current position, in a scale from 0 to 1
public function get position():Number {
if (isVertical)
return contentBounds.y / maxContentPos
else
return contentBounds.x / maxContentPos
public function set position(value:Number) {
value = Math.min(1, Math.max(value, 0))
var newContentPos:Number = value * maxContentPos
setPosition(content, isVertical ? null : newContentPos, isVertical ? newContentPos : null, false, false)
contentBounds = content.getBounds(this)
if (isVertical) {
bar.height = windowSize - (arrowUp.height + arrowDown.height)
slider.height = (windowSize / Math.max(contentBounds.height, windowSize)) * bar.height
var newSliderY:Number = arrowUp.height + (-newContentPos / contentBounds.height) * bar.height
setPosition(slider, null, newSliderY, false, false)
} else {
bar.width = windowSize - (arrowUp.width + arrowDown.width)
slider.width = (windowSize / Math.max(contentBounds.width, windowSize)) * bar.width
var newSliderX:Number = arrowUp.width + (-newContentPos / contentBounds.width) * bar.width
setPosition(slider, newSliderX, null, false, false)
updatePartsPositions()
* Creates a new Scrollbar object to scroll a single Display Object.
* @param content the object to be scrolled
* @param windowSize the height or width of the scrollbar, depending if it's vertical or not; i.e.: the dimension of the content's visible part
* @param isVertical defines if the scrollbar's parts should be placed on the right or bottom of the content, and if the content should be scrolled upways or to the right
* @param autoUpdate automatically checks for dimensions changes in any part and updates accordingly. Use only if the content will be resized
* @param contentPadding the distance between the content and all the other parts
* @param bar the bar object to be used; if null, a default one will be used
* @param slider the slider object to be used; if null, a default one will be used
* @param arrowUp the arrow up/left object to be used; if null, a default one will be used
* @param arrowDown the arrow down/right object to be used; if null, a default one will be used
public function Scrollbar(content:DisplayObject, windowSize:Number, isVertical:Boolean=true, autoUpdate:Boolean=false, contentPadding:Number=5, bar:InteractiveObject=null, slider:InteractiveObject=null, arrowUp:InteractiveObject=null, arrowDown:InteractiveObject=null) {
this.content = content
this.windowSize = windowSize
this.contentPadding = contentPadding
this.isVertical = isVertical
this.bar = bar || createDefaultBar()
this.arrowUp = arrowUp || createDefaultArrow(false)
this.arrowDown = arrowDown || createDefaultArrow(true)
this.slider = slider || createDefaultSlider()
timer = new Timer(SCROLL_DELAY)
timer.addEventListener(TimerEvent.TIMER, startScrolling)
addParts()
if (autoUpdate)
this.addEventListener(Event.ENTER_FRAME, update)
configureListeners()
update()
position = 0
protected function scroll(e:*= null):void {
// This nested if forbids the slider to continue moving if the user is
// "holding" the bar and the slider already reached the mouse position
if (e && (e is Event) && (Event(e).type == Event.ENTER_FRAME)) {
if (partHold == bar) {
var sliderBounds:Rectangle = slider.getBounds(this)
if (isVertical) {
if (mouseY > sliderBounds.top && mouseY < sliderBounds.bottom) {
stopScrolling()
return
} else {
if (mouseX > sliderBounds.left && mouseX < sliderBounds.right) {
stopScrolling()
return
scrollPixels(movement)
* Scrolls the content by the specified ammount.
* @param number number of pixels to be scrolled
protected function scrollPixels(number:Number):void {
position += number / -maxContentPos
protected function configureListeners():void {
slider.addEventListener(MouseEvent.MOUSE_DOWN, startSliderDrag)
for each (var part:InteractiveObject in [arrowUp, arrowDown, bar]) {
part.addEventListener(MouseEvent.MOUSE_DOWN, fixedPart_onMouseDownHandler)
addEventListener(MouseEvent.MOUSE_WHEEL, mouse_onWheelScrollHandler)
addEventListener(KeyboardEvent.KEY_DOWN, keyboard_onKeyDownHandler)
protected function fixedPart_onMouseDownHandler(event:MouseEvent):void
partHold = InteractiveObject(event.currentTarget)
if (partHold == arrowUp) {
movement = -PIXELS_PER_LINE
} else if (partHold == arrowDown) {
movement = PIXELS_PER_LINE
} else if (partHold == bar) {
var sliderBounds:Rectangle = slider.getBounds(this)
if (isVertical) {
if (mouseY > (sliderBounds.top + sliderBounds.height / 2))
movement = windowSize
else
movement = -windowSize
} else {
if (mouseX > (sliderBounds.left + sliderBounds.width / 2))
movement = windowSize
else
movement = -windowSize
scroll()
dispatchEvent(new ScrollEvent(ScrollEvent.SCROLL, eventOrigin))
stage.addEventListener(MouseEvent.MOUSE_UP, stopScrolling)
partHold.addEventListener(MouseEvent.MOUSE_OUT, stopScrolling)
timer.start()
protected function keyboard_onKeyDownHandler(event:KeyboardEvent):void {
switch (event.keyCode) {
case Keyboard.UP:
case Keyboard.LEFT:
movement = -PIXELS_PER_LINE
break
case Keyboard.DOWN:
case Keyboard.RIGHT:
movement = PIXELS_PER_LINE
break
case Keyboard.SPACE:
case Keyboard.PAGE_DOWN:
movement = windowSize
break
case Keyboard.PAGE_UP:
movement = -windowSize
break
case Keyboard.HOME:
movement = 0
position = 0
break
case Keyboard.END:
movement = 0
position = 100
break
default:
return
scroll()
dispatchEvent(new ScrollEvent(ScrollEvent.SCROLL, ScrollEvent.KEYBOARD))
protected function startScrolling(e:*=null):void {
timer.reset()
this.addEventListener(Event.ENTER_FRAME, scroll)
movement = (movement * (LINES_PER_SECOND * PIXELS_PER_LINE)) / stage.frameRate
dispatchEvent(new ScrollEvent(ScrollEvent.CONTINOUS_SCROLL_START, eventOrigin))
protected function stopScrolling(e:*=null) {
timer.stop()
this.removeEventListener(Event.ENTER_FRAME, scroll)
stage.removeEventListener(KeyboardEvent.KEY_UP, stopScrolling)
stage.removeEventListener(MouseEvent.MOUSE_UP, stopScrolling)
dispatchEvent(new ScrollEvent(ScrollEvent.CONTINOUS_SCROLL_STOP, eventOrigin))
if (partHold) {
partHold.removeEventListener(MouseEvent.MOUSE_OUT, stopScrolling)
partHold = null
protected function mouse_onWheelScrollHandler(event:MouseEvent) {
// The mouse wheel delta arrives inverted
var delta:int = -event.delta
movement = delta * PIXELS_PER_LINE
scroll()
dispatchEvent(new ScrollEvent(ScrollEvent.SCROLL, ScrollEvent.MOUSE_WHEEL))
//{ region Slider Drag functions
protected function startSliderDrag(event:MouseEvent) {
if (isVertical)
mouseOffset = slider.getBounds(this).y - this.mouseY
else
mouseOffset = slider.getBounds(this).x - this.mouseX
stage.addEventListener(MouseEvent.MOUSE_MOVE, onSliderDrag)
stage.addEventListener(MouseEvent.MOUSE_UP, stopSliderDrag)
dispatchEvent(new ScrollEvent(ScrollEvent.SLIDER_DRAG_START, ScrollEvent.SLIDER))
protected function stopSliderDrag(event:MouseEvent) {
stage.removeEventListener(MouseEvent.MOUSE_UP, stopSliderDrag)
stage.removeEventListener(MouseEvent.MOUSE_MOVE, onSliderDrag)
dispatchEvent(new ScrollEvent(ScrollEvent.SLIDER_DRAG_STOP, ScrollEvent.SLIDER))
protected function onSliderDrag(event:MouseEvent) {
if (isVertical) {
if (bar.height == slider.height)
return
} else {
if (bar.width == slider.width)
return
if (isVertical)
position = (this.mouseY + mouseOffset - arrowUp.height) / (bar.height - slider.height)
else
position = (this.mouseX + mouseOffset - arrowUp.width) / (bar.width - slider.width)
//} endregion
//{ region Visual functions
/// Adds all required parts to the scrollbar's display list
protected function addParts():void {
setPosition(content, 0, 0, false, false)
addChild(this.bar)
addChild(this.arrowUp)
addChild(this.arrowDown)
addChild(this.slider)
addChild(this.content)
* Updates all parts to fit the new dimensions and positions.
public function update(e:*= null):void {
contentBounds = content.getBounds(this)
updatePartsPositions()
// Ugly, but updates everything that was not update in the above call based on the content's position and size
position = position
protected function updatePartsPositions(event:Event = null):void {
if (isVertical) {
// The parts width is divided by 2 because they will be center aligned
var newX:Number = contentBounds.width +
contentPadding +
Math.max(slider.width, arrowUp.width, arrowDown.width, bar.width) / 2
setPosition(arrowUp, newX, 0, true, false)
setPosition(bar, newX, arrowUp.height, true, false)
setPosition(arrowDown, newX, arrowUp.height + bar.height, true, false)
setPosition(slider, newX, null, true, false)
} else {
var newY:Number = contentBounds.height +
contentPadding +
Math.max(slider.height, arrowUp.height, arrowDown.height, bar.height) / 2
setPosition(arrowUp, 0, newY, false, true)
setPosition(bar, arrowUp.width, newY, false, true)
setPosition(arrowDown, arrowUp.width + bar.width, newY, false, true)
setPosition(slider, null, newY, false, true)
updateMask()
private function updateMask():void {
if (content.mask && this.contains(content.mask))
removeChild(content.mask)
var contentMask:Sprite = createWindowMask()
addChild(contentMask)
content.mask = contentMask
protected function setPosition(part:DisplayObject, newX:Object=null, newY:Object=null, alignHorizontal:Boolean=false, alignVertical:Boolean=false):void {
var bounds:Rectangle = part.getBounds(this)
if (newX is Number)
part.x = int(newX) + (part.x - bounds.x) - ((alignHorizontal) ? bounds.width / 2 : 0)
if (newY is Number)
part.y = int(newY) + (part.y - bounds.y) - ((alignVertical) ? bounds.height / 2 : 0)
//} endregion
//{ region Functions to draw parts
private function createDefaultBar():Sprite {
var image:Sprite = new Sprite()
image.graphics.lineStyle(1)
image.graphics.beginFill(0xFFFFFF)
if (isVertical)
image.graphics.drawRect(0, 0, DEFAULT_SIDE, windowSize - DEFAULT_SIDE * 2)
else
image.graphics.drawRect(0, 0, windowSize - DEFAULT_SIDE * 2, DEFAULT_SIDE)
image.graphics.endFill()
//image.buttonMode = true
return image
private function createDefaultArrow(inverted:Boolean):Sprite {
var image:Sprite = new Sprite()
image.graphics.lineStyle(1)
image.graphics.beginFill(0xBFBFBF)
image.graphics.drawRect(0, 0, DEFAULT_SIDE, DEFAULT_SIDE)
image.graphics.endFill()
image.graphics.lineStyle(3)
if (isVertical) {
if (inverted) {
image.graphics.moveTo(4, 4)
image.graphics.lineTo(10, 16)
image.graphics.lineTo(16, 4)
} else {
image.graphics.moveTo(4, 16)
image.graphics.lineTo(10, 4)
image.graphics.lineTo(16, 16)
} else {
if (inverted) {
image.graphics.moveTo(4, 4)
image.graphics.lineTo(16, 10)
image.graphics.lineTo(4, 16)
} else {
image.graphics.moveTo(16, 4)
image.graphics.lineTo(4, 10)
image.graphics.lineTo(16, 16)
image.buttonMode = true
return image
private function createDefaultSlider():Sprite {
var image:Sprite = new Sprite()
image.graphics.lineStyle(1)
image.graphics.beginFill(0xBFBFBF)
if (isVertical)
image.graphics.drawRect(0, 0, DEFAULT_SIDE, windowSize - DEFAULT_SIDE * 2)
else
image.graphics.drawRect(0, 0, windowSize - DEFAULT_SIDE * 2, DEFAULT_SIDE)
image.graphics.endFill()
image.buttonMode = true
return image
private function createWindowMask():Sprite {
var image:Sprite = new Sprite()
image.graphics.lineStyle(0)
image.graphics.beginFill(0x000000, 1)
if (isVertical)
image.graphics.drawRect(0, 0, content.width + 1, windowSize)
else
image.graphics.drawRect(0, 0, windowSize, content.width + 1)
image.graphics.endFill()
image.alpha = 0
return image
//} endregion
And this is the ScrollEvent AS file:
package boppreh.ui
import flash.events.Event;
* Events related to the Scrollbar class.
* Author: Lucas Boppre Niehues ([email protected])
* Date: 09/02/2010
public class ScrollEvent extends Event
/// Dispatched when a scroll movement occurs
public static const SCROLL:String = "scroll"
/// Dispatched when the user has clicked and is holding an arrow or the bar
public static const CONTINOUS_SCROLL_START:String = "continous scroll start"
/// Dispatched when the user has clicked and dropped an arrow or the bar
public static const CONTINOUS_SCROLL_STOP:String = "continous scroll stop"
/// Dispatched when the user starts dragging the slider part
public static const SLIDER_DRAG_START:String = "slider drag start"
/// Dispatched when the user stops dragging the slider part
public static const SLIDER_DRAG_STOP:String = "slider drag stop"
/// Origin type representing the arrow up part
public static const ARROW_UP:String = "arrow up"
/// Origin type representing the arrow down part
public static const ARROW_DOWN:String = "arrow down"
/// Origin type representing the bar part
public static const BAR:String = "part"
/// Origin type representing the slider part
public static const SLIDER:String = "slider"
/// Origin type representing the keyboard
public static const KEYBOARD:String = "keyboard"
/// Origin type representing the mouse wheel
public static const MOUSE_WHEEL:String = "mouse wheel"
public var origin:String
* Creates a new ScrollEvent object.
* @param type the object type (first group of declared constants)
* @param origin the object that originated the event (second group of declared constants)
public function ScrollEvent (type:String, origin:String, bubbles:Boolean = false, cancelable:Boolean = false) {
this.origin = origin
super(type, bubbles, cancelable)
Any help would be appreciated. I've been stuck here all day. -
hi..
the code below are in working condition.. means can be compiled & run.. when drag the scrollbar, the "Welcome To Java" string message will be move left, right or up, down depend on which scrollbar u drag..
just wanna ask if the "Welcome To Java" text be changed to image?? so instead of the text shifting.. its the image tt is moving.. can anyone help me.. ??
import java.applet.*;
import java.awt.*;
import java.awt.event.*;
public class ScrollbarDemo extends Applet implements AdjustmentListener
//declare scrollbars
Scrollbar scbHort, scbVert;
//declare a canvas
ScrollMessageCanvas c;
public static void main(String[] args)
ScrollbarDemo f = new ScrollbarDemo();
f.setSize(300,200);
f.setVisible(true);
public ScrollbarDemo()
setLayout(new BorderLayout());
//create scrollbars
scbVert = new Scrollbar();
scbVert.setOrientation(Scrollbar.VERTICAL);
scbHort = new Scrollbar();
scbHort.setOrientation(Scrollbar.HORIZONTAL);
add("Center", c = new ScrollMessageCanvas());
add("East", scbVert);
add("South", scbHort);
//register listener for the scrollbars
scbHort.addAdjustmentListener(this);
scbVert.addAdjustmentListener(this);
public void adjustmentValueChanged(AdjustmentEvent e)
if(e.getSource() == scbHort)
/*getValue() and getMaximumValue() return int, but for better precision, use double*/
double value = scbHort.getValue();
double maximumValue = scbHort.getMaximum();
double newX = (value*c.getSize().width/maximumValue);
c.setX((int)newX);
else if(e.getSource() == scbVert)
/*getValue() and getMaximumValue() return int, but for better precision, use double*/
double value = scbVert.getValue();
double maximumValue = scbVert.getMaximum();
double newY = (value*c.getSize().height/maximumValue);
c.setY((int)newY);
class ScrollMessageCanvas extends Canvas
private int x = 10;
private int y = 20;
private String message = "Welcome to Java!";
public ScrollMessageCanvas()
repaint();
public void setX(int x)
this.x = x;
repaint();
public void setY(int y)
this.y = y;
repaint();
public void paint(Graphics g)
g.drawString(message, x, y);
}what should i replace this line with??
[[ private String message = "Welcome to Java!"; ]]
public void paint(Graphics g)
g.drawString(message, x, y);
can be replaced by
public void paint(Graphics g)
g.drawImage(image, 0,0);
} -
hu..
i have this JFrane that has a table which has scrollbars...
i have included in my code setResizable(false) so the user will not be able to maximize the page..
i have a function AdScroll()[that adds scrollbars] that will be called every time i add ,delete ,update a user ..
my problem is when i click on the delete and update buttons the user will not be deleted or updated from the table, but when i remove AddScroll() the user will be deleted and updated from the table but the scroll bars will not be added..
so can some one help me with this problem.
thankx
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import java.sql.*;
import java.io.*;
import javax.swing.JPanel;
import java.applet.*;
import sun.audio.*;
import java.net.*;
import java.text.*;
class UtilityMethods extends JFrame implements ActionListener
private boolean tabsVisible=false;
private File fileName;
private RandomAccessFile output;
AudioStream voice;
UtilityMethods utilities;
Connection conn;
Statement stat;
String dsnName, userStatus;
String appTable = "CUSTOMER";
Container c = getContentPane();
JTabbedPane tabs;
//JScrollPane scrollpane;
JTable dataTable, addataTable;
static String[][] tableData, adtableData;
JScrollPane scrollpane, adscrollpane,vscrollpane;
JTextField id, name, address, phone, sex, dob, photo,audio,template;
JTextArea comments;
JButton search, update, clear, add, delete, close,audio1,faceBrowse,voiceBrowse,voice1;
JPanel customerPanel, adminPanel;
JPanel backPanel, inputPanel, middlePanel, buttonPanel1, buttonPanel2, photoHolder;
JTextField adname, adusername, adpassword;
JPanel adbackPanel, adinputPanel, admiddlePanel, adbuttonPanel1, adbuttonPanel2, radioPanel;
JButton adsearch, adupdate, adclear, adadd, addelete, adclose;
JRadioButton userStat, adminStat, cleared;
ButtonGroup statusGroup;
//===================================================================================================
/*public UtilityMethods()
makeGUI();
//Create the GUI:
void makeGUI()
c.setLayout(new BorderLayout());
tabs = new JTabbedPane();
customerPanel = new JPanel(new BorderLayout());
adminPanel = new JPanel(new BorderLayout());
// voicePanel= new JPanel(new BorderLayout());
//1. Construct customers tab:
//The data input section:
inputPanel = new JPanel(new GridLayout(4, 4));
id = new JTextField(20);
name = new JTextField(20);
address = new JTextField(20);
phone = new JTextField(20);
sex = new JTextField(20);
dob = new JTextField(20);
photo = new JTextField(20);
audio = new JTextField(20);
template = new JTextField(20);
faceBrowse = new JButton("...");
faceBrowse.setBounds(210, 150, 25, 25);
inputPanel.add(new JLabel("CPR", JLabel.CENTER));
inputPanel.add(id);
inputPanel.add(new JLabel("Name", JLabel.CENTER));
inputPanel.add(name);
inputPanel.add(new JLabel("Address", JLabel.CENTER));
inputPanel.add(address);
inputPanel.add(new JLabel("Phone", JLabel.CENTER));
inputPanel.add(phone);
inputPanel.add(new JLabel("Sex", JLabel.CENTER));
inputPanel.add(sex);
inputPanel.add(new JLabel("Date Of Birth", JLabel.CENTER));
inputPanel.add(dob);
inputPanel.add(new JLabel("Customer Photo ", JLabel.CENTER));
inputPanel.add(photo);
inputPanel.add(new JLabel("Voice ", JLabel.CENTER));
inputPanel.add(audio);
customerPanel.add(inputPanel, BorderLayout.NORTH);
//The buttons section:
backPanel = new JPanel();
middlePanel = new JPanel(new BorderLayout());
buttonPanel1 = new JPanel();
buttonPanel2 = new JPanel();
search = new JButton("SEARCH");
update = new JButton("UPDATE");
clear = new JButton("CLEAR");
add = new JButton("ADD");
delete = new JButton("DELETE");
close = new JButton("EXIT");
audio1 =new JButton("Voice");
//faceBrowse = new JButton("...");
//voiceBrowse =new JButton("...");
search.setPreferredSize(new Dimension(102, 26));
update.setPreferredSize(new Dimension(102, 26));
clear.setPreferredSize(new Dimension(102, 26));
add.setPreferredSize(new Dimension(102, 26));
delete.setPreferredSize(new Dimension(102, 26));
close.setPreferredSize(new Dimension(102, 26));
audio1.setPreferredSize(new Dimension(102, 26));
faceBrowse.setPreferredSize(new Dimension(26, 26));
//voiceBrowse.setPreferredSize(new Dimension(26, 26));
search.addActionListener(this);
update.addActionListener(this);
clear.addActionListener(this);
add.addActionListener(this);
delete.addActionListener(this);
close.addActionListener(this);
audio1.addActionListener(this);
//faceBrowse.addActionListener(this);
//voiceBrowse.addActionListener(this);
buttonPanel1.add(search);
//buttonPanel1.add(faceBrowse);
buttonPanel1.add(update);
buttonPanel1.add(clear);
buttonPanel2.add(add);
buttonPanel2.add(delete);
buttonPanel2.add(close);
buttonPanel2.add(audio1);
//buttonPanel1.add(voiceBrowse);
middlePanel.add(buttonPanel1, BorderLayout.NORTH);
middlePanel.add(buttonPanel2, BorderLayout.CENTER);
photoHolder = new JPanel();
Icon curPhoto = new ImageIcon("");
Icon[] custPhotos = {curPhoto};
JList photosList = new JList(custPhotos);
photosList.setFixedCellHeight(100);
photosList.setFixedCellWidth(80);
photoHolder.add(photosList);
makeComments();
backPanel.add(middlePanel);
backPanel.add(photoHolder);
backPanel.add(comments);
customerPanel.add(backPanel, BorderLayout.CENTER);
pack();
setVisible(true);
setSize(500,700);
} //makeGUI
void updateTable()
ResultSet results = null;
ResultSet results1 = null;
try
//Get the number of rows in the table so we know how big to make the data array..
int rowNumbers = 0;
int columnCount = 6;
results = stat.executeQuery("SELECT COUNT(*) FROM CUSTOMER ");
if(results.next())
rowNumbers = results.getInt(1);
} //if
if(rowNumbers == 0)
rowNumbers = 1;
tableData = new String[rowNumbers][columnCount];
//Initialize the data array with "" so we avoid possibly having nulls in it later..
for(int i =0;i<tableData.length;i++)
for(int j=0;j<tableData[0].length;j++)
tableData[i][j] = "";
//Populate the data array with results of the query on the database..
int currentRow = 0;
results1 = stat.executeQuery("SELECT * FROM CUSTOMER ORDER BY ID");
while (results1.next())
for(int i = 0; i < columnCount; i++)
tableData[currentRow] = results1.getString(i + 1);
currentRow++;
} //while
//Create the table model:
final String[] colName = { "CPR", "Name", "Address", "Phone", "Sex", "Date OF Birth" };
TableModel pageModel = new AbstractTableModel()
public int getColumnCount()
return tableData[0].length;
} //getColumnCount
public int getRowCount()
return tableData.length;
} //getRowCount
public Object getValueAt(int row, int col)
return tableData[row][col];
} //getValueAt
public String getColumnName(int column)
return colName[column];
} //getcolName
public Class getColumnClass(int col)
return getValueAt(0, col).getClass();
} //getColumnClass
public boolean isCellEditable(int row, int col)
return false;
} //isCellEditable
public void setValueAt(String aValue, int row, int column)
tableData[row][column] = aValue;
} //setValueAt
//dataTable.setValue( new JScrollBar(JScrollBar.HORIZONTAL), 2,1 );
}; //pageModel
//Create the JTable from the table model:
JTable dataTable = new JTable(pageModel);
// dataTable.setModel();
/*if (scrollpane != null)
scrollpane.setVisible(false);
scrollpane = null;
} //if*/
//scrollpane = new JScrollPane(dataTable);
//scrollpane.setVisible(true);
if (inputPanel == null)
makeGUI();
JScrollPane scrollpane =new JScrollPane(dataTable, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
dataTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
// Create vertical box for second tab
Box box = Box.createVerticalBox();
// Create component for top
box.add(customerPanel);
// Place glue between components
box.add(Box.createVerticalGlue());
// Create component for middle
box.add(middlePanel);
// Place glue between components
box.add(Box.createVerticalGlue());
// Create component for middle
box.add(backPanel);
// Place glue between components
box.add(Box.createVerticalGlue());
// Create component for bottom
box.add(scrollpane);
// Add box to JTabbedPane
tabs.add(box, "Customer");
setResizable(false);
id.grabFocus();
pack();
repaint();
adupdateTable();
} //try
catch (Exception e)
System.out.println("Caught updateTable exception: " + e);
e.printStackTrace();
} //catch
} //updatetable
//===================================================================================================
//===================================================================================================
//Update the customer table from the database:
void updateTable(String userStatus)
this.userStatus = userStatus;
updateTable();
if(userStatus.equals("user"))
delete.setEnabled(false);
tabs.setEnabledAt(1, false);
public void actionPerformed(ActionEvent e)
FileInputStream fis = null;
if (e.getSource() == add) //The ADD button.
//User has not populated all the input fields.
if(name.getText().equals("")|| address.getText().equals("")|| phone.getText().equals("")|| sex.getText().equals("")|| dob.getText().equals("")|| photo.getText().equals(""))
JOptionPane.showMessageDialog(null, "Please fill in all the fields","Missing Fields",JOptionPane.INFORMATION_MESSAGE);
else
// save the new customer:
try
//1. take the customer's data and photo:
int userId = Integer.parseInt(id.getText());
String userName = name.getText();
String userAddress = address.getText();
String userPhone = phone.getText();
String userSex = sex.getText();
String userDateBirth = dob.getText();
String photoName = photo.getText();
String audioName= audio.getText();
File file = new File(photoName);
int fileLength = (int)file.length();
//2. Set the user's photo into the photoHolder:
photoHolder.setVisible(false);
photoHolder = null;
comments.setVisible(false);
comments = null;
Icon[] custPhotos = {new ImageIcon(photoName)};
JList photosList = new JList(custPhotos);
photosList.setFixedCellHeight(100);
photosList.setFixedCellWidth(80);
photoHolder = new JPanel();
photoHolder.add(photosList);
makeComments();
//3. Insert the data and photo into the database:
if(fileLength > 0)
fis = new FileInputStream(file);
String query = " INSERT INTO CUSTOMER VALUES('"+userId+"', '"+ userName+ "', '"+ userAddress+ "', " +" '"+ userPhone+ "', '"+ userSex+ "', '"+ userDateBirth+ "', ?,?,? ) ";
PreparedStatement pstmt = conn.prepareStatement(query);
pstmt.setBinaryStream(1, fis, fileLength);
pstmt.setString(2,photoName);
pstmt.setString(3,audioName);
pstmt.executeUpdate();
comments.setText(userName+", added.");
else
String query = " INSERT INTO CUSTOMER (id, name, address, phone, sex, dob) VALUES('"+userId+"', '"+userName+"', '"+userAddress+"', '"+userPhone+"', '"+userSex+"', '"+userDateBirth+"') ";
stat.executeUpdate(query);
comments.setText("Customer saved without a photo.");
backPanel.add(photoHolder);
backPanel.add(comments);
//updateTable();
AddScroll();
} //try
catch (Exception ee)
//The danger of putting creating the JOptionPane in here is that it will show the same message regardless of the error.
JOptionPane.showMessageDialog(null, "Customers CPR already exits!!Please enter another CPR","Invalid",JOptionPane.INFORMATION_MESSAGE);
System.out.println("Caught exception in add action: " + ee);
} //catch
} //if
}//add button
void AddScroll()
JScrollPane scrollpane =new JScrollPane(dataTable, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
scrollpane.getViewport().add(dataTable);hi i tryed the JTable.revalidate() but i still did't work...
i did this :
public void actionPerformed(ActionEvent e)
FileInputStream fis = null;
if (e.getSource() == add) //The ADD button.
//User has not populated all the input fields.
if(name.getText().equals("")|| address.getText().equals("")|| phone.getText().equals("")|| sex.getText().equals("")|| dob.getText().equals("")|| photo.getText().equals(""))
JOptionPane.showMessageDialog(null, "Please fill in all the fields","Missing Fields",JOptionPane.INFORMATION_MESSAGE);
else
// save the new customer:
try
//1. take the customer's data and photo:
int userId = Integer.parseInt(id.getText());
String userName = name.getText();
String userAddress = address.getText();
String userPhone = phone.getText();
String userSex = sex.getText();
String userDateBirth = dob.getText();
String photoName = photo.getText();
String audioName= audio.getText();
File file = new File(photoName);
int fileLength = (int)file.length();
//2. Set the user's photo into the photoHolder:
photoHolder.setVisible(false);
photoHolder = null;
comments.setVisible(false);
comments = null;
Icon[] custPhotos = {new ImageIcon(photoName)};
JList photosList = new JList(custPhotos);
photosList.setFixedCellHeight(100);
photosList.setFixedCellWidth(80);
photoHolder = new JPanel();
photoHolder.add(photosList);
makeComments();
//3. Insert the data and photo into the database:
if(fileLength > 0)
fis = new FileInputStream(file);
String query = " INSERT INTO CUSTOMER VALUES('"+userId+"', '"+ userName+ "', '"+ userAddress+ "', " +" '"+ userPhone+ "', '"+ userSex+ "', '"+ userDateBirth+ "', ?,?,? ) ";
PreparedStatement pstmt = conn.prepareStatement(query);
pstmt.setBinaryStream(1, fis, fileLength);
pstmt.setString(2,photoName);
pstmt.setString(3,audioName);
pstmt.executeUpdate();
comments.setText(userName+", added.");
else
String query = " INSERT INTO CUSTOMER (id, name, address, phone, sex, dob) VALUES('"+userId+"', '"+userName+"', '"+userAddress+"', '"+userPhone+"', '"+userSex+"', '"+userDateBirth+"') ";
stat.executeUpdate(query);
comments.setText("Customer saved without a photo.");
backPanel.add(photoHolder);
backPanel.add(comments);
//updateTable();
dataTable.revalidate();
AddScroll();
} //try
catch (Exception ee)
//The danger of putting creating the JOptionPane in here is that it will show the same message regardless of the error.
JOptionPane.showMessageDialog(null, "Customers CPR already exits!!Please enter another CPR","Invalid",JOptionPane.INFORMATION_MESSAGE);
System.out.println("Caught exception in add action: " + ee);
ee.printStackTrace();
} //catch
} //if
}//add buttonand i included this function AddScroll() that i will add the scroll bars :
void AddScroll()
JScrollPane scrollpane =new JScrollPane(dataTable, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
scrollpane.getViewport().add(dataTable);
// AbstractTableModel pageModel = (AbstractTableModel)dataTable.getModel();
// pageModel .fireTableDataChanged();
//dataTable.updateUI();
}thankx -
Browser scrollbar and Flash scrollbar ? I need help!
Now I have a problem about the scrollbar:
The height of my swf file is longer than browser height, so
the scrollbar of browser's occurred, if I scroll my mouse wheel,
the whole flash roll down, but the problem is that I have used a
scrollPanel component which write by myself, and in this situation,
when I scroll the mouse wheel, the scrollbar in flash and browser
will both in effect.
The question is that how to disable the brower scrollbar when
I scroll mouse wheel inside the scrollPanel component. In fact,
adobe already done this, if my cursor inside a textfield object,
the scrollbar of bowser will not get focus. How to achieve this
effect? My english is bad, but I need help!i recently downloaded trails of flash cs4 and web premium package cs4 (took a day to download at high speed starbuck's internet). couldnt get the setup.exe to work or the uninstaller to work. surfing tech support over next couple weeks to try various agents was useless and expensive until i finally reached someone with useful info. all the agents had foriegn accents and read from scripts and web support pages until yesterday, when i reached a guy who told me two things i'll report to various forums addressing this same issue:
1. download windows uninstaller program from their website (google: windows ininstaller). this program is different from the one that doesnt work in the programs and features area of control panel when you try to uninstall adobe products from there.
2. windows explorer 8, the newest version, DOES NOT download adobe softare properly and leaves things out, causing all sorts of issues including the setup.exe program not working. download firefox browser from mozella (google: firefox) and use it for all adobe downloads. apparently the old windows explorer 7 will work, but if you already have explorer 8 installed its easiest to just use firefox.
i'm spending the next couple days downloading the 4.14 G web premium trail with firefox and will report if this works. -
Hello.
I am trying to build a webpage with a fixed sized window in
the centre of the page. Within this window I would like to display
some photos I have taken. What I would like to happen is for people
to be able to scroll right to view my pictures, but for the main
navigation not to disapear. So I thought I could incorporate a
horazontal scrollbar into the central box, so that whatever content
is in the box is scrollable. I have noticed things called div tags
and I think that this is the way forward, although I don't seem to
be able to use these effectivly.
Can anybody help me please.
Thanks
SThe scrollbar works, you can try using a simple JComponent with a set preferred size instead of the JTextPane and it will work. The problem is that the JTextPane always wraps its lines, so it doesn't need to be wider - therefore the scrollbar doesn't appear (or doesn't display the knob in case it's always displayed). You'll have to find a way to somehow disable line wrapping in that JTextPane, or you'll have to use another component to display your data, for example JTable.
-
Need some help disabling/enabling the scrollbar on our website
Dear Sir/madam,
I am having some difficulty with our website to disable or hide the scrollbar on our website.
The thing is that i want to disable/hide the scrollbar when i got a small web page with only one alinea of text.
And i want to enable the scrollbar when i got more then one alinea of text and my webpage is a lot bigger.
Can anyone help me out?
Here is my CSS code file and html file
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Trend installatietechniek BV - Home</title>
<meta name="Keywords" content="domotica, schakelaar, rookmelder, elektrische apparatuur">
<meta name="Description" content="Domotica is een verzamelwoord voor het aan elkaar koppelen van verschillende systemen, zoals rookmelder, video-intercom en rookmelder.">
<meta name="robots" content="index, follow">
<meta name="revisit-after" content="1 month">
<meta name="googlebot" content="noodp">
<meta name="language" content="dutch, nederland, netherlands, nl">
<meta name="author" content="trenbv.nl, Trend Installatietechniek BV">
<style type="text/css">
</style>
<link href="trendbv2.css" rel="stylesheet" type="text/css" />
<style type="text/css">
a:visited {
color: #666666;
</style>
<script type="text/javascript">
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
</script>
</head>
<body onload="MM_preloadImages('Beelden/hoofdnavigatieData.png','Beelden/hoofdnavigatieElektrot echniek.png','Beelden/hoofdnavigatieBeveiliging.png','Beelden/hoofdnavigatieTechnischBeh.p ng')">
<div id="achtergrondmidden"><img src="Beelden/achtergrond.png" alt="achtergrondTrendbv" width="1024" height="751" border="0" /></div>
<div id="fotogrootmidden"><img src="Beelden/Groot Home.jpg" width="944" height="360" alt="domoticaTrendbv" /></div>
<div id="balkmidden"></div>
<div id="logoTrendonder"></div>
<div class="broodtekst" id="contactgegevens">
<strong>Trend Installatietechniek BV</strong><br />
<br />
Kazemat 33<br />
3905 NR Veenendaal
<p><strong>E:</strong> <a href="[email protected]:[email protected]">[email protected]</a><br />
<strong>T:</strong> (0318) 51 63 02</p>
</div>
<div class="broodtekst" id="subnavigatie"></div>
<div class="navigatiebovenaan" id="navigatiebovenaan">home <a href="Tekenwerk.html">tekenwerk</a> <a href="klanten.html">klanten</a> <a href="ons bedrijf.html">ons bedrijf</a> <a href="contact.html"> contact</a></div>
<div class="broodtekst" id="tekstkolom">
<p>Trend Installatietechniek is een specialist op het gebied van elektrotechniek en bestaat sinds 1998. Inmiddels is Trend uitgegroeid tot een gerenommeerd elektrotechnisch bedrijf met vestigingen in Veenendaal en Assen.<br />
<br />
Trend Installatietechniek heeft sinds jaar en dag een reputatie op het gebied van aanleg van datanetwerken en elektrotechnische installaties.<br />
U verwacht van een elektrotechnisch installateur vakmanschap en kwaliteit. Naast kwalitatief hoogstaand werk onderscheiden wij ons door een klantgerichte houding en korte levertijden. <br />
<br />
Wij voeren opdrachten uit voor klanten zoals het ZIGGO, KNAW, de Universiteit van Amsterdam en KPN. Hierbij wordt veel verwacht van onze monteurs. Daarom werken wij uitsluitend met ervaren, gediplomeerde elektrotechnische monteurs. <br />
</p>
</div>
<div id="tekstfoto1"><img src="Beelden/beeldhome2.png" alt="fotodomotica1" width="130" height="130" border="0" /></div>
<div id="tekstfoto2"></div>
<div id="hoofdnavigatieDomotica"><a href="Wat is domotica.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image5','','Beelden/hoofdnavigatieDomotica.png',1)"><img src="Beelden/hoofdnavigatieDomotica-kort.png" alt="Hoofdnavigatie Domotica" name="Image5" width="583" height="65" border="0" id="Image5" /></a></div>
<div id="hoofdnavigatieData"><a href="Wat is Data.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image6','','Beelden/hoofdnavigatieData.png',1)"><img src="Beelden/hoofdnavigatieData-kort.png" alt="Hoofdnavigatie Data" name="Image6" width="472" height="65" border="0" id="Image6" /></a></div>
<div id="hoofdnavigatieElektrotechniek"><a href="Wat is Elektrotechniek.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image7','','Beelden/hoofdnavigatieElektrotechniek.png',1)"><im g src="Beelden/hoofdnavigatieElektrotechniek-kort.png" alt="Hoofdnavigatie Elektrotechniek" name="Image7" width="356" height="65" border="0" id="Image7" /></a></div>
<div id="hoofdnavigatieBeveiliging"><a href="Beveiliging en camerasystemen.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image8','','Beelden/hoofdnavigatieBeveiliging.png',1)"><img src="Beelden/hoofdnavigatieBeveiliging-kort.png" alt="Hoofdnavigatie Beveiliging" name="Image8" width="245" height="65" border="0" id="Image8" /></a></div>
<div id="hoofdnavigatieTechnischBeheer"><a href="Technisch beheer.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image9','','Beelden/hoofdnavigatieTechnischBeh.png',1)"><img src="Beelden/hoofdnavigatieTechnischBeh-kort.png" alt="Hoofdnavigatie Technisch Beheer" name="Image9" width="134" height="65" border="0" id="Image9" /></a></div>
<div id="body"></div>
<div id="kaderlinks"></div>
<div id="kaderrechts"></div>
<div id="hoofdnavigatie"></div>
<div id="achtergrondvertikaal"></div>
</body>
</html>
CSS file:
@charset "UTF-8";
#body {
position: fixed;
width: 100%;
z-index: 1;
left: 0px;
top: 0px;
background-image: url(Beelden/achtergrondbody.png);
height: 100%;
background-repeat: repeat-y
#kaderlinks {
position: fixed;
left: 50%;
top: 0px;
width: 5px;
height: 100%;
z-index: 21;
background-image: url(Beelden/kader.png);
background-repeat: repeat-y;
margin-left: -512px;
#fotogrootmidden {
position:absolute;
left:50%;
top:52px;
width:944px;
height:360px;
z-index:2;
margin-left: -472px;
#achtergrondmidden {
position: absolute;
left: 50%;
top: 0px;
width: 1024px;
height: 751px;
z-index: 3;
margin-left: -512px;
#balkmidden {
position: absolute;
left: 50%;
top: 378px;
width: 642px;
height: 49px;
z-index: 3;
margin-left: -130px;
background-image: url(Beelden/blauwebalk.png);
background-position: left;
#achtergrondvertikaal {
position: absolute;
left: 50%;
top: 751px;
width: 1024px;
height: 100%;
z-index: 4;
margin-left: -512px;
background-image: url(Beelden/achtergrondonder.png);
#logoTrendonder {
position: fixed;
left: 50%;
height: 100%;
z-index: 5;
background-image: url(Beelden/logotrendonder.png);
background-repeat: no-repeat;
margin-left: -439px;
background-position: bottom;
width: 179px;
#contactgegevens {
position:fixed;
left:50%;
width:130px;
z-index:10;
margin-left: -410px;
color: #000;
vertical-align: bottom;
top: 100%;
margin-top: -260px;
#contactgegevens p strong {
color: #2B79BE;
#navigatiebovenaan {
position:absolute;
left:50%;
top:25px;
width:404px;
height:23px;
z-index:12;
text-align: right;
margin-left: 50px;
#navigatiebovenaan a:link {
color: #999;
#navigatiebovenaan a:hover {
color: #2B79BE;
#hoofdnavigatieDomotica {
position:absolute;
left:50%;
top:58px;
width:596px;
height:82px;
z-index:16;
margin-left: -118px;
#hoofdnavigatieData {
position:absolute;
left:50%;
top:58px;
width:467px;
height:82px;
z-index:17;
margin-left: -3px;
clip: rect(auto,auto,auto,0px);
#hoofdnavigatieElektrotechniek {
position:absolute;
left:50%;
top:58px;
width:363px;
height:82px;
z-index:18;
margin-left: 110px;
#hoofdnavigatieBeveiliging {
position:absolute;
left:50%;
top:58px;
width:254px;
height:82px;
z-index:19;
margin-left: 220px;
#hoofdnavigatieTechnischBeheer {
position:absolute;
left:50%;
top:58px;
width:139px;
height:84px;
z-index:20;
margin-left: 330px;
#subnavigatie {
position: absolute;
left: 50%;
top: 393px;
width: 581px;
height: 19px;
z-index: 11;
margin-left: -103px;
#tekstkolom {
position: absolute;
left: 50%;
top: 458px;
width: 400px;
height: 345px;
z-index: 13;
margin-left: 50px;
text-align: left;
font-size: 12px;
#tekstfoto1 {
position: absolute;
left: 50%;
top: 470px;
width: 150px;
height: 380px;
z-index: 14;
margin-left: -116px;
#tekstfoto2 {
position: absolute;
left: 556px;
top: 620px;
width: 130;
height: 130;
z-index: 15;
margin-left: -116px;
#kaderrechts {
position: fixed;
left: 50%;
top: 0px;
width: 5px;
height: 100%;
z-index: 22;
background-image: url(Beelden/kader.png);
background-repeat: repeat-y;
margin-left: 512px;
.navigatiebovenaan {
font-family: Arial, Helvetica, sans-serif;
color: #999;
font-size: 12px;
.broodtekst {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
line-height: 16px;
a:link {
text-decoration: none;
color: #000;
a:hover {
color: #2B79BE;
text-decoration: none;
.h1 {
font-family: Arial, Helvetica, sans-serif;
color: #2B79BE;
font-size: 17px;
font-weight: lighter;Start by remvoing the code in RED.
#body {
position: fixed;
width: 100%;
z-index: 1;
left: 0px;
top: 0px;
background-image: url(Beelden/achtergrondbody.png);
height: 100%;
background-repeat: repeat-y
Browser scrollbars appear by default in all pages requiring them. You don't need to do anything to make them appear. I don't think you understand Fixed positioning well enough to be using it so much in your CSS. It has a purpose but probably not what you think.
See position:fixed sticky text demo.
http://alt-web.com/DEMOS/CSS2-Sticky-Text.shtml
Nancy O. -
Need help creating horizontal scrollbar in graphic timelime (built in AI)!
I am trying to use Catlyst to build an interactive scrollbar on a graphic timeline build in Adobe Illustrator, I want to be able to scroll from one end of timeline to the other. Can anyone help? Thanks!
Can you post a screenshot of the timeline you are trying to convert. It will help in accurate response.
You would probably need to do it in two step:
- Have the graphic timeline converted into Datalist element, and make the data repeatable.
- Create a Horizontal Scrollbar component and add it to the datalist component (timeilne)
- If you have the Horizontal scrollbar designed, then select it and convert it to a Horizontal Scroll component (using the HUD - the black overlay that comes up when you select a graphic element)
- After conversion you would need to define the parts of the H. Scrollbar (Track, thumb, right button, left button). Note: It helps if you designed your H. Scrollbar with these components in AI/PSD.
- Now come back to the artboard, and select the H. Scrollbar by clicking on it.
- Cut the H. Scrollbar
- Click the Datalist element, and go to Edit Parts (in HUD)
- Paste the H . Scrollbar inside the Datalist element. This will attach the scrollbar to the data.
Hope this helps,
Fu -
Tutor 14.0 Problem - Please help! Vertical scrollbar missing
I recently upgraded from Tutor 12.2 to Tutor 14.0.
When I publish the Desk Manuals for each actor, the html page does not have the vertical scrollbar, and you can't access the documents that are at the bottom of the list.
Has anyone experienced this? Is there a fix for this? I searched for patches in Oracle Support but could not locate any.
I tried to troubleshoot this by replacing the tutor.css files and tutor_script.js file with those from 12.2, but that didn't work. Is there another file that controls the output of HTML files when you publish through Tutor Publisher?
Please help!
Thanks!Ok i am sorry about giving the wall paper here is to more precise problem
and
if you could possibly tell me a simple way of Importing a .gif file and drawing in Java.
if(rect == true)
if(cex>=origx&&cey>=origy)
drx[rc] = cx;
dry[rc] = cy;
urx[rc] = cex-cx;
ury[rc] = cey-cy;
rc++;
trc++;
else if(cex>=origx&&cey<origy)
drx[rc] = cx;
dry[rc] = cey;
urx[rc] = cex-cx;
ury[rc] = cy-cey;
rc++;
trc++;
else if(cex<origx&&cey<origy)
drx[rc] = cex;
dry[rc] = cey;
urx[rc] = cx-cex;
ury[rc] = cy-cey;
rc++;
trc++;
else if(cex<origx&&cey>origy)
drx[rc] = cex;
dry[rc] = cy;
urx[rc] = cx-cex;
ury[rc] = cey-cy;
rc++;
trc++;
}Thx -
Scrollbar in Panel.....help
hi.... i have to add images(picture) in Panel .because I have to add more pictures(image), scrollbar (or JScrollPane) will require please help me how to do.
U can also help in respect of following program, Thanks.
// <applet code="AnImageApplet" width="400" height="400"></applet>
// use: >appletviewer AnImageApplet.java
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.io.*;
import javax.imageio.ImageIO;
public class AnImageApplet extends Applet
public void init()
setLayout(new BorderLayout());
add(new AnImagePanel());
public static void main( String[] args )
Applet applet = new AnImageApplet();
Frame frame = new Frame( "Image" );
frame.addWindowListener(closer);
frame.add(applet);
frame.setSize(400,400);
frame.setLocation(200,200);
applet.init();
frame.setVisible(true);
private static WindowListener closer = new WindowAdapter()
public void windowClosing(WindowEvent e)
System.exit(0);
class AnImagePanel extends Panel
BufferedImage image;
public AnImagePanel()
try
image = ImageIO.read(//"yu.jpg");
new File("images/cougar.jpg"));
catch(IOException e)
System.out.println("Read error: " + e.getMessage());
public void paint(Graphics g) {
g.drawImage(image, 20, 20, this);
}// <applet code="AnImageApplet" width="400" height="400"></applet>
import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import java.io.*;
import javax.imageio.ImageIO;
public class AnImageApplet extends Applet {
public void init() {
setLayout(new BorderLayout());
ScrollPane scrollPane = new ScrollPane();
scrollPane.add(getContent());
add(scrollPane);
private Panel getContent() {
Panel panel = new Panel(new GridLayout(0,2,5,5));
panel.add(new AnImagePanel("images/cougar.jpg"));
panel.add(new AnImagePanel("images/bclynx.jpg"));
panel.add(new AnImagePanel("images/redfox.jpg"));
panel.add(new AnImagePanel("images/mtngoat.jpg"));
return panel;
public static void main( String[] args ) {
Applet applet = new AnImageApplet();
Frame frame = new Frame( "Image" );
frame.addWindowListener(closer);
frame.add(applet);
frame.setSize(400,400);
frame.setLocation(200,200);
applet.init();
frame.setVisible(true);
private static WindowListener closer = new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
class AnImagePanel extends Panel {
BufferedImage image;
public AnImagePanel(String path) {
try {
image = ImageIO.read(new File(path));
} catch(IOException e) {
System.out.println("Read error: " + e.getMessage());
public void paint(Graphics g) {
int x = (getWidth() - image.getWidth())/2;
int y = (getHeight() - image.getHeight())/2;
g.drawImage(image, x, y, this);
public Dimension getPreferredSize() {
return new Dimension(image.getWidth(), image.getHeight());
}
Maybe you are looking for
-
Warranty void on Apple engraved products?
Can anyone help me? I'm thinking about buying a 3rd Gen Nano from the online Apple store for my daughter for Christmas and getting it engraved, but I've been informed recently that if I have it engraved it will void the warranty, is this correct? I h
-
Desname parameter works fine in Report builder but fails in Forms builder
Hi, I need some help with my current task. Here is my problem. I am working on Oracle 10g. My reports and Forms builder version is 10.1.2.3.0. My objective is to use Forms builder to call a report which will direct the output directly to the printer
-
How to unlock my iphone if i forgot my password
i really need help
-
Hi! I have been a 6280 user and have just upgraded to the N80, i have a couple of minor problems and irritations which may be simple to solve but i can't find them. In the gallery there is the option to look at pictures and videos but i would prefer
-
Help! I'm missing my photos in iPhoto from 04/2011-03/2012!
They just disappeared. I haven't deleted anything. I can't find them anywhere. Not in events, nor just photos, nor photostream. They're not in the iPhoto trash. They were still on my iPad, so I synced it thinking that I would put them back onto the M