Is it somehow possible to make the vertical scrollbar scroll horizontally?
10 2087
Is it somehow possible to make the vertical scrollbar scroll horizontally?
Are you talking about a JScrollBar? It has an orientation property ...
Are you talking about a JScrollBar? It has an orientation property ...
I don't think that's it; the orientation simply tells the JScrollBar how to display:
horizontally or vertically. Just a scrollbar fires events when it has been moved
and the user is free to interpret those events. I'm a bit curious though what the
OP has in mind ...
kind regards,
Jos
What is it like a joke or something? You want to make a program where you click on a vertical scroll bar and it scrolls it horizontally?
I once say an application that looked like a simple dialog box, it asked the question "Do you approve of the job Bill Clinton is doing?" It had two buttons, one said "Yes, I do." the other said "No, I don't." The funny part was when you moved your mouse toward the "No" button it would move away from your mouse. You could never click on it because it would move away. It was obviously a joke program but still pretty clever.
Hah! - import java.awt.*;
-
import java.io.*;
-
import javax.swing.*;
-
-
class HackedScrollpane extends JScrollPane {
-
public HackedScrollpane(Component view) {
-
super(view);
-
}
-
-
public void twist() {
-
JScrollBar vert = this.verticalScrollBar;
-
JScrollBar horz = this.horizontalScrollBar;
-
this.verticalScrollBar = horz;
-
this.horizontalScrollBar = vert;
-
}
-
}
-
-
public class TextAreaExample implements Runnable {
-
public static void main(String[] args) throws IOException {
-
SwingUtilities.invokeLater(new TextAreaExample());
-
}
-
-
public void run() {
-
JTextArea textArea= new JTextArea(20, 30);
-
textArea.setFont(new Font("serif", Font.PLAIN, 16));
-
try {
-
textArea.read(new FileReader("TextAreaExample.java"), null);
-
} catch (IOException e) {
-
throw new RuntimeException(e);
-
}
-
JFrame f = new JFrame("TextAreaExample");
-
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
-
HackedScrollpane sp = new HackedScrollpane(textArea);
-
sp.twist();
-
f.getContentPane().add(sp);
-
f.pack();
-
f.setLocationRelativeTo(null);
-
f.setVisible(true);
-
}
-
}
Are you talking about a JScrollBar? It has an orientation property ...
it's for a friend of mine, who wants to have a photo gallery of his works on his homepage (he is a painter) and he wants to use the vertical scrollbar for the horizontal scrolling (the horizontal scrollbar is hidden). I know, this is a little bit strange, but I can't figure out, how it could be done.
Thanks for all your answers!
it's for a friend of mine, who wants to have a photo gallery of his works on his homepage (he is a painter) and he wants to use the vertical scrollbar for the horizontal scrolling (the horizontal scrollbar is hidden). I know, this is a little bit strange, but I can't figure out, how it could be done.
Thanks for all your answers!
Web page? Then why use Java? This is starting to sound like JavaScript hacking, now. How is Java involved?
... twist() ROFL!
<embarrassed>
Please don't tell anyone you saw me write that hack!
</embarrassed/>
<embarrassed>
Please don't tell anyone you saw me write that hack!
</embarrassed/>
giggle
note: I didn't hear it from RedSon.
Web page? Then why use Java? This is starting to sound like JavaScript hacking, now. How is Java involved?
Java is involved because i don't see any other ways to make it work. If you think there're other options fot that - i'd appreciate your help.
And of course this is not a JavaScript hacking.
P.S. sorry for not answering so long
Sign in to post your reply or Sign up for a free account.
Similar topics
by: David Pratt |
last post by:
Hi. I am putting together a database application on Zope. I have built
a pager for my records (20 per page) but do not want the browser scroll
bars to reset to the top of the browser each time the...
|
by: Don Schneider |
last post by:
I tried to setup a frameset which consists of 4 different subframes.
Each of these subframes should fetch a different web page from the internet and display it completely (!).
BUT: the vertical...
|
by: Pachydermitis |
last post by:
Hi all you Experts,
I need to scroll a listbox horizontally.
For the life of me I cannot get it to move. I can successfully scroll
it vertically.
I have the handle for the listbox and the scroll...
|
by: lolo |
last post by:
hello. happy new year.
I'm trying to build a website for my wife and she is adament on having
a horizontal thumbnail scrolling div. great. I have a good vertical
scrolling thing, but can't...
|
by: alwayssmiling |
last post by:
hi,
In my application for the panel control im adding seperate vertical scroll control, if i manually scrolls it, then its working fine i.e im able to scroll. But how to scroll with the mouse...
|
by: jazeelkm |
last post by:
hi,
i am a beginer in the world of C#
1. I want to hide the vertical scrollbar of a listbox . In properties
i can hide the horizontal scrollbar , but there s no option for
vertical scroll...
|
by: platoon1sc |
last post by:
Hi guys.I have a problem with Internet Explorer in my web-application. I have a vertical scrollbar into my jsps but firefox show the vertical srollbar, but IE doesn't. IE show a blank space where...
|
by: bai |
last post by:
In my page, I have both horizontal and vertical scroll bars.
I want to to some action on Vertical scrollbar click/move and some other action on horizontal scrollbar move/click. How to know whether...
|
by: ayamopamo |
last post by:
Hi- I am trying to center a web page. It seems like this should be very simple to do, but apparently it isn't my day. I have successfully centered the background by calling it in the css body tag:...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
| |