Does anyone know if it is possible to set programmaticall y the position of a JScrollPane vertical scrollbar slider?
I load a some components like textfield editorpane labels etc
into a panel wrapped in a JScrollPane.
The vertical slider follows the length of the components but I want on load the beginning of the panel to be visible and not the end.
ie the slider is always at the bottom or in the middle not in the begining
I mean, I don't want to force the user to use the slider right
away to go up to the beginning of the panel.
Is there a way to do this?
Thanks,
1 8058 horace1 1,510
Recognized Expert Top Contributor
say you have a JTextArea called textArea try selecting the start of the text and then request focus, e.g. -
textArea.select(0,1);
-
textArea.requestFocus();
-
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Richard van Wegen |
last post by:
Dear All
I want to use the horizontal scrollbar control, but I can't figure out
how to change the width of the slider, i.e. the bit that you drag left
& right. With other controls (eg Textbox), the inbuilt scrollbar
changes its slider width depending on how much text is in the box.
But the slider width of the horizontal scrollbar control always seems
to be the same size.
Can anyone tell me how to do this?
|
by: Z |
last post by:
Hi,
I have problem with auto-scrolling frames in IE (6.0 on Xp, but same happens
with IE 5.5 on Win2k):
If I set scrolling="auto" to frame, IE reserves space where vertical
scrollbar normally goes and doesn't render contents there when scrollbar is
hidden.
Here is frameset with left and right frames:
|
by: Frnak McKenney |
last post by:
I have a (small) multi-table database application which allows
edits, print reports, and has two scrolling screen displays which
show information merged from multiple tables.
I'm having trouble with one of the scrolling displays which is
implemented as a DataGrid with several custom DataGridColumnStyles.
When the Form containing the DataGrid is made visible the initial
rows of the DataGrid's DataView source display as one might expect....
|
by: Clans Of Intrigue |
last post by:
Hello, this is my first post here so apologies if it's in the wrong
place, inappropriate or embarrassingly stupid - please let me know :)
My problem seems quite simple - I've redirected stdout to a wxTextCtrl,
so that any trace messages appear in a log window at the bottom of my
app. The problem is that whenever I update the text, the scrollbar
resets to the top - i.e. to the earliest log message. What I really
want it to do is reset...
|
by: Colin McGuire |
last post by:
Hello experts, this is a repost but I have been (much) more clear.
I want to know the position of the horizontal scrollbar in a textbox
as a percentage
- if the horizontal scrollbar is hard left,
I want to display 0% on the form.
- if the horizontal scrollbar is smack in the middle,
I want to display 50% on the form.
- if the horizontal scrollbar is 2/3rd along the X-axis,
| |
by: weston |
last post by:
I'm making a foray into trying to create custom vertical scrollbars and
sliders, and thought I had a basic idea how to do it, but seem to be
having some trouble with the implementation.
My thinking was:
(a) create a div for the slider / scroll nub to move within
(b) attach event handlers which, onmousedown, specify the slider/nub is
moveable, and onmouseup, specify it's not
(c) attach an event handler to the contaning div which,...
|
by: charlie1 |
last post by:
I have a text box that has a vertical scrollbar on the right hand side - whever the textbox is opened, the vertical scrollbar defaults to the bottom.
How can I make the scrollbar default to the top? (ie, so that you start at the top of the textbox and have to scroll down through it - it is happening the other way around at the moment).
Ta
|
by: =?Utf-8?B?SmVzcGVyLCBEZW5tYXJr?= |
last post by:
Hi,
I have a somewhat long calculation report printed out in a RichTextBox. To
find or monitor a particular value, users scroll down to the location of the
data in the RichTextBox. However, when the user changes the input data, a
recalculation is made and a new report is generated. This resets the
RichTextBox vertical scroll bar to the top.
I would like to be able to read the position the scroll bar is moved to
before recalculation....
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |