Scrollbar in Frame
I have designed a frame. Now how can i add a scrollbar on this frame. I mean something like enabling scrollbar in frame. Is there any method or variable which has to be set to enable scrollbar?
Did you know we have a Swing forum too?Yeah, sorry for that. I will post this kind of post in swing forum here after.
And why do you want to add just a Scrollbar? Wouldn't
you need a JScrollPane? If so, there are online
tutorials for that.I have many fields where fields are crossing the whole frame of window size. If i can have a scrollbar then i can able to see all fields.
Similar Messages
-
Dear All
How can we put a scrollbar on frame so that all the coponents may visible on frame.
Thanksimport javax.swing.*;
public class Main{
public static void Main(String[args]){
new Main().start();//to get out of static context
public void start(){
JFrame frame = new JFrame("How to put a scrollbar in a frame");// initiates the frame and gives it the so title
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);// when you click the X button the program stops and you don't accidentally have 54 applications running...
frame.setSize(700,700); // makes it big, units in pixels
frame.add(new JScrollBar());// adds the scrollbar to the frame
frame.setVisible(true);//self evident
}This should get you started.
From here, I suggest you get the book "Swing Hacks" by O'reilly media... then get the book "Graphic Java 2: Swing" and do as much research on swing and AWT as possible.
You are able to find them online at www.scribd.com for free, though I bought them myself. -
Hi,
I have a problem with the JScrollPane.
When adding some components to a panel inside a JScrollPane whereby most components are invisible at the start and made visible by user actions, the scrollbars disappear when making components visible.
More precisely, I always resize the whole frame when making a component visible. If the frame is too big to fit on the screen, they first appear, but when making one more component visible, they disappear again.
Very strange is also, that when I minimize the dialog and then maximize it again, they reappear again. This sounds like a bug for me...
Any help would be appreciated. BTW, I'm using Java 1.6.0.
import java.awt.BorderLayout;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JToolBar;
public class ScrollBarTest
public static void main(String[] args)
final JFrame frame = new JFrame("ScrollBar Test");
frame.setLayout(new BorderLayout());
Font font = new Font(Font.DIALOG, Font.PLAIN, 80);
JPanel panel = new JPanel(new GridBagLayout());
GridBagConstraints cons = new GridBagConstraints();
cons.gridwidth = GridBagConstraints.REMAINDER;
final List<JLabel> labels = new ArrayList<JLabel>(20);
for (int i = 0; i < 20; i++)
JLabel label = new JLabel("Label " + i);
label.setFont(font);
labels.add(label);
if (i > 0)
label.setVisible(false);
panel.add(label, cons);
frame.add(new JScrollPane(panel), BorderLayout.CENTER);
JToolBar toolbar = new JToolBar();
JButton button = new JButton("Klick");
button.addActionListener(new ActionListener()
int firstInvisible = 1;
@Override
public void actionPerformed(ActionEvent e)
labels.get(firstInvisible).setVisible(true);
firstInvisible++;
frame.pack();
toolbar.add(button);
frame.add(toolbar, BorderLayout.NORTH);
frame.pack();
frame.setVisible(true);
}If the frame is too big to fit on the screen, they first appear, but when making one more component visible, they disappear again.I reset the maximum frame height and it works the way I would expect it to. That is the frame height doesn't change and scrollbars appear.
frame.pack();
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
Rectangle bounds = env.getMaximumWindowBounds();
int height = bounds.height;
Dimension d = frame.getSize();
if (d.height > height)
d.height = height;
frame.setSize(d);
} -
JScrollPane in a JFrame scrollbars visible but not functional no thumbtabs
Here is the code that I compiled and run on J2SE v. 1.4.2 (runtime b28). I looked through the various related articles and nothing seems to help with this issue. The scrollbars appear along with the panel but the thumbtabs are not present. Any help would be appreciated.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Test {
public static void main(String[] args){
Test rce = new Test();
JFrame frame = new JFrame("Test Scroll");
JScrollPane scrollBar = new JScrollPane();
scrollBar.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
scrollBar.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
Component rcePage = rce.createComponents();
scrollBar.getViewport().add(rcePage, null);
frame.getContentPane().add(scrollBar, null);
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
frame.pack();
frame.setSize(400, 400);
frame.setVisible(true);
public Component createComponents() {
JPanel pan = new JPanel();
JLabel label = new JLabel("This is a Test!");
pan.setBorder(BorderFactory.createEmptyBorder(
0, //top
0, //left
0, //bottom
0) //right
pan.setLayout(null);
label.setBounds(100, 100, 80, 20);
pan.add(label);
return pan;
}This is a very common mistake. When you put a JPanel in a scrollpane, the scrollpane will use the panel's preferred size to determine if scrolling is needed or not. If the panel is using a LayoutManager this is generally done for you automatically. But in your case you set the layout to null, and then it is your responsibility to make sure that the getPreferredSize() method of the panel returns the correct size.
One way to fix this in the code you posted would be to override the getPreferredSize() of the panel, like so:
public Component createComponents() {
JPanel pan = new JPanel() {
public Dimension getPreferredSize() {
return getSize();
}Then the scrollbars will appear if you make the frame smaller.
But what I really suggest is that you use a LayoutManager. -
Scrollbar problem - any ideas?
I know another scrollbar problem...ive read the posts but cant solve it. Anyone got any ideas?
got a program called Map which draws a map (using paint()) of a web site. I can get it to work but often there are so many links they go off the page.I need a scrollbar.
In main i set up a frame: JFrame frame=new JFrame("M");
Then set up scrollbar: JScrollPane cf = new JScrollPane();
cf.setHorizontalScrollBarPolicy (JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS );
cf.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS );
Then add scrollbar to frame: frame.getContentPane().add(cf);
Then add Map() - my main prog: cf.add(new Map());
(Map constructor calls repaint() - paint method draws to screen. main program extends JComponent)
All i get is a blank (grey frame) with a scrollbar :) ...doesnt show Map - paint
I can ignore scrollbar and use a container instead -
Container c=frame.getContentPane()
then set its layout : c.setLayout(new BorderLayout());
and add Map() to it : add(new Mapper(),BorderLayout.CENTER);
It works fine - but i need a scrollbar...
Thanks for your time&helpHers the code for my main Mapper program (which is loaded first) and the Scan program(below).I know the structures all over the place+thats the problem. I would like a scrollbar. Also everytime i scan a new window opens, it would be good if only 1 ever opened.Ive been fiddling for days and am lost.Can anyone sort it out? I think the codes ok, just needs restructuring...
The main Mapper program :
package project.e;
import javax.swing.*;import java.awt.*;import java.awt.geom.*;import java.awt.event.*;
import java.io.*;import java.net.*;import java.lang.Math.*;import java.util.*;
public class Mapper extends JComponent{
static int w = 1000;
static int h = 1000;
static String [] Lnks = new String [5000]; //Lnks
public Mapper()
{ repaint();}
public void paint(Graphics g){
Graphics2D g2D=(Graphics2D)g;
Toolkit tk = Toolkit.getDefaultToolkit();
Image img = tk.getImage("c:/windows/desktop/project/e/wirecube.gif"); //setup images
Image rimg = tk.getImage("c:/windows/desktop/project/e/bwirecube.gif");
int ww=(w/2);int hh=(h/2);
g2D.setFont(new Font("Times New Roman", Font.PLAIN,12));
g2D.setPaint(Color.cyan);
g2D.drawString("Web Page Scanned : ",10,50); g2D.drawString(Scan.url,120,50);
g2D.drawString("Total Links Found : ",10,100); g2D.drawString(String.valueOf(Scan.x),120,100);
g2D.drawImage(rimg,ww-88,50,this); g2D.setFont(new Font("Times New Roman", Font.PLAIN,12));
g2D.setPaint(Color.green);
g2D.drawString(Scan.url,ww-88,50);
int a=w/5;
int up=0;
int lx=0;
g2D.translate(ww,hh);
g2D.translate((-ww-a)+10,-300);
for (int i=0;i<(Scan.x);i++){ //loop - drawing all (5 per line)
if (lx==5){g2D.translate((-ww-ww),100);lx=0;} //every 5 times
g2D.translate(a,0);
g2D.drawImage(img,0,0,this); //img
g2D.setFont(new Font("Times New Roman", Font.PLAIN,12));
g2D.setPaint(Color.green);
g2D.drawString(Lnks[up],ww-ww,hh-hh-10); //URL
if (Scan.tl==true){g2D.drawString(Scan.IorE[up],ww-ww,hh-hh-25);}lx=lx+1;up=up+1;}}
public static void main(final String [] args){
System.arraycopy(Scan.Links,0,Lnks,0,Scan.x);
JFrame frame=new JFrame("Mapper"); //frame setup
JMenu menu = new JMenu("Menu");
JMenuItem scan = new JMenuItem("Scan");
scan.setMnemonic(KeyEvent.VK_S);
scan.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,Event.CTRL_MASK));
scan.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){Scan.main(args);}});
//call Scan
JMenuItem downloadLink = new JMenuItem("download-Link");
downloadLink.setMnemonic(KeyEvent.VK_L);
downloadLink.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_L,Event.CTRL_MASK));
downloadLink.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){GetLink.main(args);}});
JMenuItem downloadImage = new JMenuItem("download-Image");
downloadImage.setMnemonic(KeyEvent.VK_I);
downloadImage.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I,Event.CTRL_MASK));
downloadImage.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){GetImage.main(args);}});
JMenuItem Quit = new JMenuItem("Quit");
Quit.setMnemonic(KeyEvent.VK_Q);
Quit.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q,Event.CTRL_MASK));
Quit.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){System.exit(0);}});
JMenuBar menuBar = new JMenuBar();
menu.add(scan);
menu.add(downloadLink);
menu.add(downloadImage);
menu.add(Quit);
menuBar.add(menu);
frame.setJMenuBar(menuBar);
Container c = frame.getContentPane();
c.setLayout(new BorderLayout());
c.add(new Mapper());
c.setBackground(new Color(0,0,0));
frame.setJMenuBar(menuBar);
frame.setBounds(0,0,w,h);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);}}
Scan :
package project.e;
import java.awt.*;import java.awt.geom.*;import java.awt.event.*;import javax.swing.*;import javax.swing.text.*;import javax.swing.text.html.*;import java.io.*;import java.net.*;
public class Scan{
static String [] Links = new String[5000]; //array of links
static String [] IorE = new String[5000]; //array - Internal or External
static int x = 0; //length
static String url = new String(); //url
static String type = new String(); //link/image
static boolean tl;
static String l = new String("links");
static String i = new String("images");
public static void main(String [] args){
Links = new String[5000]; //need to repeat ini. for rescanning
IorE = new String[5000];
x = 0;
url = new String();
type = new String();
EditorKit kit = new HTMLEditorKit();
Document doc = kit.createDefaultDocument();
doc.putProperty("IgnoreCharsetDirective",Boolean.TRUE);
try{
type = JOptionPane.showInputDialog(null,"Please enter file type to scan for - links / images ");
url = JOptionPane.showInputDialog(null,"Please enter URL"); //get url (var.) to map - dialog box
Reader rd = getReader(url); // Create a reader on the HTML content
kit.read(rd, doc, 0); // Parse the HTML.
ElementIterator it = new ElementIterator(doc);
javax.swing.text.Element elem;
while ((elem = it.next()) != null){
if (type.equals(l))
tl =true;
//int bol = url.indexOf(".com");
SimpleAttributeSet s = (SimpleAttributeSet)
elem.getAttributes().getAttribute(HTML.Tag.A);
if (s != null)
Links[x]=String.valueOf((s.getAttribute(HTML.Attribute.HREF)));
String tmp = Links[x].substring(0,1);
if (! tmp.equals("h")){
if (! tmp.equals("/"))
{Links[x]="/"+Links[x];}} //if string doesnt start with h or / //then add a / to start
if (Links[x].startsWith("/")){System.out.println("Internal Link");IorE[x]="Internal Link";} //if starts with / then internal
else{
if (Links[x].startsWith(url)){System.out.println("Internal Link");IorE[x]="Internal Link";} //else if starts with url then internal
else{
String tmp3 = url.substring(11); //else if contains url - (http://www.) eg. 123.ibm.com then internal
int b=0;
b=Links[x].indexOf(tmp3);
if (b>0){System.out.println("Internal Link");IorE[x]=("Internal Link");}
else{System.out.println("External Link");IorE[x]=("External Link");}}} //else must be external (doesnt start with / or url or contain middle bit of url)
System.out.print("Link : ");
System.out.print(x);
System.out.println();
System.out.println(Links[x]);
System.out.println();
x=x+1;
if (type.equals(i))
tl=false;
if ( elem.getName().equals( HTML.Tag.IMG.toString() ) ){
Links[x] = String.valueOf(elem.getAttributes().getAttribute( HTML.Attribute.SRC ));
System.out.print("Image : ");
System.out.print(x);
System.out.println();
System.out.println(Links[x]);
System.out.println();
x=x+1;}
Mapper.main(args);
}catch(Exception e){e.printStackTrace();}
static Reader getReader(String u) throws IOException{
if (u.startsWith("http:")){
// Retrieve from Internet
URLConnection con = new URL(u).openConnection();
return new InputStreamReader(con.getInputStream());}else{
// Retrieve from file.
return new FileReader(u);
Also got 2 extra - GetImage & GetLinks...they just go away and do there own stuff...no painting required so cool.The probelms is between Mapper+Scan...
Thanks for your time&help
Oly -
Why script show error in Frame 1 ?
hi , i use a dynamic scrollbar
i put my scrollbar in movieclip : mc
and i have 2 frame that in every of them i have one scrollbar ...
i use this script For enabling scrollbar in frame 2 :
_scrollbar = new Scrollbar();
_scrollbar.init(mc.content, mc.contentMask, mc.track, mc.slider);
but for my scrollbar 2 that i have : content1 , contentMask1, track1, slider1 and in frame 2 when i use this script :
_scrollbar = new Scrollbar();
_scrollbar.init(mc.content1,mc.contentMask1,mc.track1,mc.slider1);
i get error and my scollbar in frame 2 not work :
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.freeactionscript::Scrollbar/init()[C:\\scroller-dynamic-scrollbar-v2\com\freeactionsc ript\Scrollbar.as:53]
at Mainver/frame1()[Mainver::frame1:2]
the weired things is when i move the scrollbar content of frame 2 to frame 1 ( both my scroll in frame1 now ) the is no problem !! and all think work !!
is there any tip to say this script load in Frame 2 ??!
( remeber i put my script in frame 1 of my main stage and no script for scrollbar in mc movie clip exist )Thanks Kglad , if i cant solve it with script i must use your idea and it works for me.
and thanks amy for taking a look to my problem , well i`m weak in AS3
i dont get your point and find where if (_contentMask) { .......... must be put !!
i write the full script of this scrollbar and hope you can help me :
main.As
* Scrollbar
* VERSION: 2.0
* DATE: 5/04/2011
* AS3
* UPDATES AND DOCUMENTATION AT: http://www.FreeActionScript.com
package
import flash.display.MovieClip;
import flash.events.Event;
import flash.events.MouseEvent;
import com.freeactionscript.Scrollbar;
public class Mainver extends MovieClip
// assets on stage
public var content:MovieClip;
public var contentMask:MovieClip;
public var track:MovieClip;
public var slider:MovieClip;
// vars
private var _scrollbar:Scrollbar;
private var _scrollbar1:Scrollbar;
* Constructor
public function Mainver()
_scrollbar = new Scrollbar();
_scrollbar.init(mc.content, mc.contentMask, mc.track, mc.slider);
and in scrollbar.as :
* Scrollbar
* VERSION: 2.0
* DATE: 5/04/2011
* AS3
* UPDATES AND DOCUMENTATION AT: http://www.FreeActionScript.com
package com.freeactionscript
import flash.display.MovieClip;
import flash.display.Sprite;
import flash.display.Stage;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.geom.Rectangle;
import com.greensock.TweenLite;
import com.greensock.easing.*;
public class Scrollbar extends Sprite
// scrollbar assets
private var _content:MovieClip;
private var _contentMask:MovieClip;
private var _slider:MovieClip;
private var _track:MovieClip;
// vars
private var _scrollSpeed:Number = .5; // seconds to movie to new position
private var _scrollWheelSpeed:int = 10; // pixels per tick
private var _root:Stage;
* Initialize method
* @param $content Main content container
* @param $contentMask Content mask. Masking is set dynamically. Do not set mask on the timeline.
* @param $track The track of the scrollbar
* @param $slider The slider (dragger)
* @param $scrollSpeed The speed at which the content movies
public function init($content:MovieClip, $contentMask:MovieClip, $track:MovieClip, $slider:MovieClip, $scrollSpeed:Number = .5):void
// save passed objects and variables
_content = $content;
_contentMask = $contentMask;
_slider = $slider;
_track = $track;
_scrollSpeed = $scrollSpeed;
// give content a mask
_content.mask = _contentMask;
// save a reference to the stage
_root = _slider.parent.stage;
// hide scrollbar assets for now
_slider.visible = false;
_track.visible = false;
// enable scrollbar interactivity
enable();
* Enable Scrollbar interaction
public function enable():void
// make dragger a button
_slider.buttonMode = true;
// add event listeners
_slider.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownHandler);
_root.addEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheelHandler);
_root.stage.addEventListener(MouseEvent.MOUSE_UP, onMouseUpHandler);
// check if scrollbar is needed
verifyHeight();
* Disable Scrollbar interaction
public function disable():void
// make dragger not a button
_slider.buttonMode = false;
// remove event listeners
_slider.removeEventListener(MouseEvent.MOUSE_DOWN, onMouseDownHandler);
_root.removeEventListener(MouseEvent.MOUSE_WHEEL, onMouseWheelHandler);
_root.removeEventListener(MouseEvent.MOUSE_UP, onMouseUpHandler);
* On mouse wheel handler
* @param $event Takes MouseEvent argument
private function onMouseWheelHandler($event:MouseEvent):void
// define parameters
var scrollDistance:int = $event.delta;
var minY:int = _track.y;
var maxY:int = _track.height + _track.y - _slider.height;
// check if there's room to scroll
if ((scrollDistance > 0 && _slider.y <= maxY) ||
(scrollDistance < 0 && _slider.y >= minY))
// move dragger
_slider.y = _slider.y - (scrollDistance * _scrollWheelSpeed);
// make sure we don't come out of our boundries
if (_slider.y < minY)
_slider.y = minY;
else if (_slider.y > maxY)
_slider.y = maxY;
// move content
updateContentPosition();
* On mouse down handler
* @param $event Takes MouseEvent argument
private function onMouseDownHandler($event:MouseEvent):void
var newRect:Rectangle = new Rectangle(_track.x, _track.y,
0, _track.height - _slider.height);
_slider.startDrag(false, newRect);
_root.addEventListener(Event.ENTER_FRAME, updateContentPosition);
* On mouse up handler
* @param $event Takes MouseEvent argument
private function onMouseUpHandler($event:MouseEvent):void
_slider.stopDrag();
if (_root != null)
_root.removeEventListener(Event.ENTER_FRAME, updateContentPosition);
* Update content position
* @param $event Takes optional Event argument
private function updateContentPosition($event:Event = null):void
var _scrollPercent:Number = 100 / (_track.height - _slider.height) * ( _slider.y - _track.y);
var newContentY:Number = _contentMask.y + (_contentMask.height - _content.height) / 100 * _scrollPercent;
TweenLite.to(_content, _scrollSpeed, {y:newContentY, ease:Cubic.easeOut});
* Position Slider based on where the content is.
* Use this function if content is being moved by anything outside the scrollbar class
public function updateSliderPosition():void
var contentPercent:Number = Math.abs((_content.y - _contentMask.y) / (_content.height - _contentMask.height) * 100);
var newDraggerY:int = (contentPercent / 100 * (_track.height - _slider.height)) + _track.y;
_slider.y = newDraggerY;
* Check if scrollbar is necessary
public function verifyHeight():void
if ( _contentMask.height >= _content.height )
_slider.visible = false;
_track.visible = false;
else
_slider.visible = true;
_track.visible = true;
* Garbage collection method
public function destroy():void
// check if dragger is being dragged
if (_root.hasEventListener(Event.ENTER_FRAME))
_slider.stopDrag();
_root.removeEventListener(Event.ENTER_FRAME, updateContentPosition)
// disable interaction
disable();
i hope you can tell me where and how your code must be put to fix reading only frame1 and work with frame 2 too !! -
My app pops up a new JFrame in which I create and add a JPanel with a scrollable JTable as follows, however no vertical scrollbar appears.
frame.getContentPane().add(new ResultsPanel(),BorderLayout.CENTER);
frame.setVisible(true);
public class ResultsPanel extends JPanel {
private void jbInit() throws Exception {
JTable table = new JTable(data, cols);
table.setPreferredSize(new Dimension(300,200));
JScrollPane pane = new JScrollPane(table);
this.add(pane);
}Set the preferred size of the scrollpane, not the table.
-
Is it possible to creat overflow scrollbar for tables? I have
seen many references to creating scrollbar for frames and layers
but I need to creat one for a table. Is this possible and how.
ThanksThanks for the heads up though, Murray! The error was in the
content being
pulled from the MySQL database...probably why I never caught
it before. Got
'em all sorted out, now!
;o)
Shane H
[email protected]
http://www.avenuedesigners.com
=============================================
COMING SOON - Infooki [unboxed]:
http://infooki.sourtea.com/
Web Dev Articles, photography, and more:
http://sourtea.com
=============================================
Proud GAWDS Member
http://www.gawds.org/showmember.php?memberid=1495
Delivering accessible websites to all ...
=============================================
"Murray *ACE*" <[email protected]> wrote
in message
news:[email protected]...
> There are 4 validation errors on that page, Shane. The
police are at your
> door just now with the warrent.
>
> --
> Murray --- ICQ 71997575
> Adobe Community Expert
> (If you *MUST* email me, don't LAUGH when you do so!)
> ==================
>
http://www.dreamweavermx-templates.com
- Template Triage!
>
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
>
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
>
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
> ==================
>
>
> "Shane H" <[email protected]> wrote
in message
> news:[email protected]...
>> Yep -
>>
http://sourtea.com/articles.php?ref=20
>>
>> --
>> Shane H
>> [email protected]
>>
http://www.avenuedesigners.com
>>
>> =============================================
>> COMING SOON - Infooki [unboxed]:
>>
http://infooki.sourtea.com/
>> Web Dev Articles, photography, and more:
>>
http://sourtea.com
>> =============================================
>> Proud GAWDS Member
>>
http://www.gawds.org/showmember.php?memberid=1495
>>
>> Delivering accessible websites to all ...
>> =============================================
>>
>>
>> "Sohaila" <[email protected]> wrote
in message
>> news:[email protected]...
>>> Is it possible to creat overflow scrollbar for
tables? I have seen many
>>> references to creating scrollbar for frames and
layers but I need to
>>> creat one for a table. Is this possible and how.
>>> Thanks
>>
>>
>
> -
HTML Frames not using custom scrollbar in Flex 3 mx:HTML
I've been working on an app that uses a custom skin in Flex 3. The app has a help window. The help contains an HTML with frames. Problem is, the main app vertical scrollbar custom skin is being ignored for the HTML Frames scrollbar (what looks like the classic version of Halo - maybe). This only happens with frames. It happens no matter how or where I place my HTML or HTMLLoader. If I dont have frames the custom scrollbar is used. Is there a node im missing in my skin css (obviously not VScrollBar or ScrollBar - the two standard used by Flex)? or some other way to connect the HTML Frames scrollbar to my custom skin.
I'm not a noob but not an expert.
Thanks.
See attached image for example.Take the code of the jsp file :
<%@ page language="java" %>
<%@ taglib uri="WEB-INF/struts-html.tld" prefix="html" %>
<html>
<head>
<title> First Struts Application </title>
</head>
<body>
<table width="500" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
<tr bgcolor="#36566E">
<td height="68" width="48%">
<div align="left">
<img src="images/hht.gif" width="220" height="74">
</div>
</td>
</tr>
<tr>
<td> </td>
</tr>
</table>
<html:form action="Lookup"
name="lookupForm"
type="wiley.LookupForm" >
<table width="45%" border="0">
<tr>
<td>Symbol:</td>
<td><html:text property="symbol" /> </td>
</tr>
<tr>
<td colspan="2" align="center"><html:submit/> </td>
</tr>
</table>
</html:form>
</body>
</html> -
Removing scrollbars on the JSP page of frames created by included JSP files
Hi All,
In the iternet sales B2B application which we are developing, has a blank JSP file. Wherein we are adding other JSP files on it, loading trough JS.
When we are adding it is making the various jsp files in the form of the frames, and each frame has different JSP page. So it is adding scrollbars on each frame if the size of the page exceeds the size of frame.
we don't want the scrollbars. Kindly suggest to remove these scrollbars, and all the pages should look as a single JSP page.
Thanks & Regards
EKtaHi
set scrolling="no" while creating frames
Murali.K.N -
[CS2/CS3] - TreeView frame & ScrollBar roller
Hello, please could anyone advise me with 2 following probles:
1) Is it possible to insert black frame list f.e. ListBox ?
2) Is it possible to change size of "scroller" of my own ScrollBar for which I use methods SetMaximum() to scroll my panel ?
Thank you for your advices, marxinWhen I see resource file, there is definition of StringListData to storing names of clubs( which is in sample), should I replace it with IID_IBOOLLISTDATA to store vector of checkboxes:
Class
kWLBCmpListBoxWidgetBoss,
kTreeViewWidgetBoss,
/** Furnishes application framework with widgets as needed */
IID_ITREEVIEWWIDGETMGR, kWLBCmpTVWidgetMgrImpl,
/** Adapts our data model to the needs of the application framework */
IID_ITREEVIEWHIERARCHYADAPTER, kWLBCmpTVHierarchyAdapterImpl,
/** Hold names of the list item */
IID_ISTRINGLISTDATA, kStringListDataImpl,
/** Adding for saving checkboxes states ? */
IID_ISTRINGLISTDATA, kBoolListDataImp,
/** Display selection message */
IID_IOBSERVER, kWLBCmpListBoxObserverImpl,
In WLBCmp sample TreeViewAdapter get strings (names) from IStringListData, but I don't know how to save the state from CBoxes and store it to this BoolListData ?
I hope you'll have some time to help me
Thank you, marxin -
How to act a form like a frame with scrollbars?
How can i setup a form like a frame?
I got a long list of input fields in my form which doesn't fit on a page.
So i was thinking of creating a form that has frame with scrollbar function, like the iframe in HTML.
Is there any way to do this??Not sure I understand what you want, but I set up a page with 2 items on one row, 3 on the next. http://apex.oracle.com/pls/apex/f?p=23834:30 is that the sorta thing you want to do? - control where the items appear?
If so - you can just use drag and drop layout, or on the items settings (Displayed settings), specify whether or not it appears on a new line or not.
Ta,
Trent -
How to add scrollbar to the JInternal Frame
How to add scrollbar to JInternal Frame?
I have One JInternal frame i want it should have a scrollbar when we reduces its size.[url http://java.sun.com/docs/books/tutorial/uiswing/components/scrollpane.html]How to Use Scroll Panes
-
Hello Experts,
I am new in oracle forms and I am using Oracle forms 11.1.2.2.0 with weblogic 10.3.6 generic at windows 7 64 bit.
My java version is jdk1.7.0_51.
I have a database table say as ITEM_MASTER.This table has 20 columns.Now I have to show these 20 columns in oracle form in a single frame.I have used the wizard method to make database block in oracle forms but This datablock takes too much width.
I wand to show all the columns with in a short width frame in oracle forms using horizontal scroll bar.But I am unable to do this.Please suggest me.
thank you
regards
aaditya.This can be accomplished using a Stacked Canvas. There are numerous examples of how to use a stacked canvase on the web. For example: https://www.google.com/search?q=oracle+forms+how+to+use+a+stacked+canvas
Craig... -
hi all,
iam doing a project in swing . in it there are 6 tabs, is it possible to add a scrollbar for the tabs . i have tried this by adding the tabbed pane to the scrollpane but the scroll bars are not visible.
could u pls tell me how to add a scroll bar for the tabs.have you tried:
JFrame f = new JFrame();
JTabbedPane t = new JTabbedPane();
/* add your tabs */
JScrollPane p = new JScrollPane(t);
f.getContentPane().add(p);thomas
Maybe you are looking for
-
How do I upload videos from iphone 4 to my computer? Uploaded pictures but can't upload video. Please help.
-
Sorry, posted in wrong forum. Edited by: gms5002 on Mar 4, 2008 12:51 PM
-
Difference Between Oracle Replication & Oracle Streams.
Hi All, I am trying to evaluate Oracle Streams & Oracle Replication technologies. I need to know what are exact differences between 2 technologies? Advantages (if any) of using Oracle Streams against Oracle Replication. After reading Oracle Streams d
-
Update VM with dynamic memory fails
Update-VM orchestrator action seems to fail to handle updating VM's with dynamic memory, is there a solution for that or am I doing something wrong? scenario: vm with dymanic memory 512 to 2048, I try to update VM memory with Update-VM action and set
-
REP-0186: Daemon failed to listen to port Forms Server Not starting
Hello Team, E-Biz 11.5.0.2 O/S HP-UX B.11.11 when we are stating the Forms server it is sarting with status 0, but when we check the status it is exiting with the following error *08/27/12-17:42:46 :: starting Reports Server for qhrp on port 7074.* R