java amateur
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Prime wrote:You can get hold of a JScrollPane's scroll bars using getHorizontalScrollBar and getVerticalScrollBar. Check what methods those have.
java amateur
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Prime wrote:I think you've missed the methods of JScrollBar about the current, minimum and maximum value.
getMaximum
int getMaximum()Gets the maximum value of the adjustable object.
Returns:
the maximum value of the adjustable object
java amateur
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Prime wrote:The maximum indicates the maximum position for the scroll bar.
java amateur
java amateur
Rob Camick wrote:A picture tells us nothing about your code. (...)
Rob Camick wrote:A(...)You've been asked for a SSCCE before.
java amateur
pictures are to make clear my requirement, not to ilustrate any code
when and where?
Rob Camick wrote:
pictures are to make clear my requirement, not to ilustrate any code
But the problem is with your code, not the picture. So how can we help you fix your code if we can't see it?
when and where?
Do you actually read the suggestions you've been given in previous postings?. Apparently not and apparently you don't want any help because you still haven't posted one. Too late now. I'm not going to repeat myself every time I try to help you.
java amateur
Rob Camick wrote:You've already been given the answer. If it doesn't work, then there is something wrong with your code and I know I'm not a mind reader so I can't solve it without seeing the code.
I've already helped you several times in the past, apparently you don't want my help in the future.
If you don't want the help thats fine with me, but I find that strange since you are the one that asked the question?
java amateur
you should remember that in one ocasion you needed ten posts to finally understand what i wanted
by the way: i guess you still dont understand what i'm looking for...
if you dont want to help, that's your problem
miguel lisboa wrote:
Rob Prime wrote:The maximum indicates the maximum position for the scroll bar.
as these methods arent clear enough to me, i wrote:
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
java amateur
Rob Prime wrote:
miguel lisboa wrote:
Rob Prime wrote:The maximum indicates the maximum position for the scroll bar.
as these methods arent clear enough to me, i wrote:
You are now changing the maximum value to the current maximum value. Is it the maximum value you want to change, or some other value? The minimum value perhaps, or the current?
the maximum value of the adjustable object
java amateur
miguel lisboa wrote:>>If I don't understand a question its generally because its a poorly worded question. By the way I was the only person who even made an attempt to uderstand what you where asking in that question, so again don't blame me, look in the mirror
your arrogance blinds you - go back again and check how clearly stated (since the begining) was what i intended; you'r the one who is a poor reader - my luck...
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Prime wrote:(...)
Miguel, I tried to let you find out by yourself, but apparently you are not getting my hints.
The value for a scroll bar is the amount by which it has scrolled. The minimum is 0, the maximum is determined by the preferred size of the component inside the JScrollPane*. To scroll all the way to the left from code you set the value to be equal to the minimum. To scroll all the way to the right from code you set the value to be equal to the maximum.
* For JScrollBars that are not part of JScrollPanes you need to set both the minimum and maximum manually.
java amateur
java amateur
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
java amateur
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
java amateur
Miguel, I tried to let you find out by yourself, but apparently you are not getting my hints.
I just found that my code works - after the component has already been shown. Consider the following example:
i tried my way of using foto width and height but it doesnt work
Rob Camick wrote:(...)
i tried my way of using foto width and height but it doesnt work
Even with your working SSCCE, Miguel still has problems because we don't know exactly what he is trying to do. So once again he is verbally trying to describe the problem. It never ends...
How does that describe the problem? We have no idea what the foto width and height are. Or what layout manager is used etc., etc..
"If you give someone a fish, they eat for the day. If you teach someone to fish they eat for life".
miguel lisboa wrote: (...)
but, as the images i display have ramdom sizes, i tried setting it programatically:
java amateur
he doesnt ever care to read what people posts!!!:
java amateur
miguel lisboa wrote:thank you again, Rob
from what i understand we got it going when manually setting label's preferred size: but, is there a way of adapting it to ramdom fotos sizes?
i tried my way of using foto width and height but it doesnt work
the problem is that i need an automated way of setting label's preferred size, else i get some pictures truncated - if i set preferred size much wider then i get blank zones in display area
java amateur
Rob Camick wrote:So you got some hack to work, but you don't know what the original problem is or why the hack works? So the next time you have a problem you still won't know how to solve it because the problem will manifest itself differently.
Its amazing that a problem that should take 5 minutes to solve took a couple of days and 15 replies.
Great solution, keep up the good work.
java amateur
Rob Camick wrote:Sorry, almost every posting I've made has been helpfull because it tried to explain the value of a SSCCE.
(...).
Rob Camick wrote:(...)Your solution is terrible, there is absolutely no reason to be playing around with the preferred size of the label (especially doing it twice). That was a bad example Rob gave you and will lead you to bad habits, like the solution you've come up with.(...)
java amateur
first you said i had no ssscce, that i described things only verbally
then i already had a sscce, now you'r talking about a reasonable sscce...
when you were corrected by Rob Prime, you had a typo
now, is Prime who gives bad examples
Rob Camick wrote:
when you were corrected by Rob Prime, you had a typo
No idea what you are talking about.
Rob Camick wrote:(...)
You will need to use the table.convertRowIndexToView(...) method to make sure your code is changing the view colors.
If you need further help then you need to create a SSCCE (Short, Self Contained, Compilable and Executable, Example Program), that demonstrates the incorrect behaviour.
Rob Camick wrote:(...)
you don't understand the example. There is no reason to set the preferred size of the label.
java amateur
too late again: a few hours ago i private messaged Prime telling him all about nullLayout and setSize() - just check with him
go just right ahead with the info the poster needs
you know? not everyone is a good teacher
Miguel, I tried to let you find out by yourself, but apparently you are not getting my hints.
java amateur
java amateur
Whatever you say buddy! And I believe this tiny ad too:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|