I am not understanding something...

Well, actually there are many things I don't understand. Like, for example, how my fellow american citizens can be stupid enough to sign up for another four years of...oh, never mind, what's the point?
What's really bothering me at the moment is this "feature", which I have been completely incapable of implementing successfully. It seems simple, which is exactly why I am annoyed by my continued failure to do it properly.
All I want (ok, not ALL I want, but certainly something I want) is to have a real-time list of data automatically keep itself scrolled to the most current entry. You know, kind of like you'd expect it to do in any reasonable gui, right?
I figured, no problem. A JList inside a JScrollPane. Then a function to add data to the JList and max out the vertical scrollbar. Launch n+1 threads which all reference the "parent" object in order to update the list.
Well, even before implementing this, I knew there was a small problem. For the "classic" feel, the list should only autoscroll if you aren't using the list at the time - like scrolling up or looking at some other section of the list. But, one thing at a time.
Immediate problem. It doesn't work as expected. Much of the time, the scrollbar doesn't go all the way to the bottom, but instead stays just above the last one or two lines.
Another problem. Sometimes the list just flat out goes BLANK - no scrollbar, no nothing. It only comes back when something else is added to the list.
Knowing a little something about Swing, I figured it was possible the add-to-list command wasn't finishing in time for the autoscroll command to do it's job properly. In other words, the scrollbar was maxing out, then the items were appearing in the list. So I used SwingUtilities.invokeLater() in an attempt to "delay" the scrolling.
No luck. It might have had some effect, but not enough. I tried putting a sleep timer in the invokeLater(), but that just paused my whole application.
I'd be happy to provide code etc if anyone cares (originally posted at http://forum.java.sun.com/thread.jspa?threadID=579946 but tweaked since then), but what I really want is a solution. I.E. I'm not sure I'm even going about this problem in the right way, which is why I defined it in such general terms up above. If it can/should be done without a JList or JScrollPane, that's fine.

Well, actually there are many things I don't
understand. Like, for example, how my fellow american
citizens can be stupid enough to sign up for another
four years of...oh, never mind, what's the point?Sorry,. that's a topic for a different thread... :-)
http://forum.java.sun.com/thread.jspa?threadID=578435&start=0&tstart=0
What's really bothering me at the moment is this
"feature", which I have been completely incapable of
implementing successfully. It seems simple, which is
exactly why I am annoyed by my continued failure to
do it properly.I know the feeling.
All I want (ok, not ALL I want, but certainly
something I want) is to have a real-time list of
data automatically keep itself scrolled to the most
current entry. You know, kind of like you'd expect it
to do in any reasonable gui, right?Sure.
I figured, no problem. A JList inside a JScrollPane.
Then a function to add data to the JList and max out
the vertical scrollbar. Launch n+1 threads which all
reference the "parent" object in order to update the
list.Sounds logical (or a JTable, but same difference).
Well, even before implementing this, I knew there was
a small problem. For the "classic" feel, the list
should only autoscroll if you aren't using the list
at the time - like scrolling up or looking at some
other section of the list. But, one thing at a time.Could be annoying to the user, yeah.... How do you know, except to know that focus is on the list, in which case you don't scroll, and thus you'd have to explicitly have focus leave the list to get back to "normal".
Immediate problem. It doesn't work as expected. Much
of the time, the scrollbar doesn't go all the way to
the bottom, but instead stays just above the last one
or two lines.What if you try:
list.scrollRectToVisible(new Rectangle(0, list.getSize().height-1, 1, 1));
Of course, setVisibleIndex() or whatever should work.
Another problem. Sometimes the list just flat out
goes BLANK - no scrollbar, no nothing. It only comes
back when something else is added to the list.Sounds like a thread concurrency problem.
Knowing a little something about Swing, I figured it
was possible the add-to-list command wasn't finishing
in time for the autoscroll command to do it's job
properly. In other words, the scrollbar was maxing
out, then the items were appearing in the list. So I
used SwingUtilities.invokeLater() in an attempt to
"delay" the scrolling.I would guess you aren't using invokeLater() in the right place, that place being in the code that updates the list model, which in turn, tells the list view to update itself. And that might be coupled with a synchronization problem as well, depending on how you are updating the list model.
No luck. It might have had some effect, but not
enough. I tried putting a sleep timer in the
invokeLater(), but that just paused my whole
application.right.
I'd be happy to provide code etc if anyone cares
(originally posted at
http://forum.java.sun.com/thread.jspa?threadID=579946
but tweaked since then), but what I really want is a
solution. I.E. I'm not sure I'm even going about this
problem in the right way, which is why I defined it
in such general terms up above. If it can/should be
done without a JList or JScrollPane, that's fine.No reason it can't.
It seems a common enough feature to want in a gui,
surely there's a common way of implementing it?There is a "proper" way, which clearly you aren't doing. :-)

Similar Messages

  • Not understanding something about margins and header

    Pages 2 5.5.3
    Mac OS 10.10.2
    I'm trying to rap my head around how pages does headers.
    I think of a header as a place were stuff goes so that it occurs at the top of each page. I would expect it to be positioned at the bottom of the top margin. For instance, with a top margin of .5 in and a header of 1. in, I would expect my header stuff to start at .5 in and my non header stuff to start at 1.5 in.
    This is what I observed. Her are a couple of clarifications to start:
    –All measures are vertical measures
    –Origin represents the offset were an object placed at zero in the body of the document appears.
    Top Margin, set to .5 in. Origin at .5 in as expected.
    -Add a 1 in header. origin moves to 1 in. I  would expect the origin to move to 1.5 in, .5 in top margin + 1 in for the header.
    -Add some 24 pt text to the header and the origin moves down even further, by at least a 1/3 in (24/72). Since 1/3 in is clearly less than one in, i would not expect the origin to change at all since the text would easily fit within 1 in.
    This is what i am seeing. Without a header, the origin is the height of the top margin. The header appears to ignore the top margin and makes its start at the header height and grows downward from there. This seems wrong.
    Can someone steer me straight?

    Here's my settings.
    Here's my results.
    See, the header starts at 1. inch. I do not have the dimensions reversed.

  • Cannot retrieve my e-mail "browser sent request server could not understand. Size of request header field exceeds server limit"

    Upgraded to Firefox 5.0.1 yesterday. No, after logging on to firefox, which takes me to my comcast page and when I try to get
    my e-mail I get this message "your browser sent a request this server could not understand. Size of request header field exceeds server limit" Then it says something about "cookies" I also tried to connect to other sites and get similar messages. Just to let you know I am not a guru, and 80 years old, but I did not have this problem with the previous version. Question, why are the headers repeated? Could that be the problem???

    This issue can be caused by corrupted cookies.
    Clear the cache and the cookies from sites (e.g. comcast) that cause problems.
    "Clear the Cache":
    * Firefox > Preferences > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Firefox > Preferences > Privacy > Cookies: "Show Cookies"

  • "could not read the file because the plug-in could not understand the file."

    "could not read the file because the plug-in could not understand the file."
    I keep getting this error when trying to open some of my illustrator files. Usually after trying 5 or 6 time it will mysteriously open without a problem. I've reinstalled Illustrator and that didn't work. I've uninstalled and reinstalled CS3 and that didn't work.
    Why does it sometimes open and sometimes not???
    I've lost I don't know how many hours screwing around with this and REALLY pissing me off!!!
    AURGH!

    I think this has something to do with the PNG plugin.

  • Just started using illustrator and do not understand why i cannot fill this trace

    alright so i have my image that i have traced, its all chucnked up into groups (hair, eyes, etc...)  but if i try to select say the hair and try to fill it, it does it really bad
    http://img835.imageshack.us/img835/1310/picture6qs.png
    and here i use the live paint tool which does an okay job but lines show through in places where i dont want them to
    http://img543.imageshack.us/img543/6118/picture7g.png
    i do not understand what important piece of information i missed, i thought i could just trace something and fill in the colors, apparently its not that simple.
    this programs works in shapes right? i dont get why that even though everything looks closed off, and is connected to my knowledge, i cant get it to fill
    (at least correctly)
    cuz it feel like could do this in flash in no time, but i'd like to do this kind of work using programs that are specifically designed for it.
    any sort of help would be greatly appreciated.

    Kristacattack,
    The tracing results in separate paths. The straight lines show where the open filled paths start and end.
    In the first sample, you may drag with the Direct Selection Tool over the top where the straight lines meet and Ctrl/Cmd+J to join the the paths; you may do the same elsewhere to create continuous/closed paths (hopefully, you will only drag over the two endpoints, otherwise you will have to find and delete superfluous Anchor Points).
    This may be better than just cheating with the Live Paint Tool because the artwork becomes more coherent.
    Edit: Hi Monika.

  • I do not understand why Edge is bad

    I do not get why everyone is bashing edge program?  I want to join but am hesitant as I think I am missing something.
    I have a family plan and all our phones are off contract.  Both edge and buying a discounted phone will require 2 years commitment so in all cases I have to assume I will have my phone for 2 years.  If I get a new S5 I pay $40/mo for my line and $200 upfront.  If I use edge I pay $15/mo plus $25/ mo for the phone lease.  It appears to be a wash except I do not have to pay the $200 upfront and AFTER 2 yrs my bill COULD drop $25/mo per phone until I decide to replace it.
    What is the problem and what am I missing?

    People that bash it do not understand what the program is or how it works. Anyone with a 10 GB or more plan it will SAVE money. Less than 10 GB it may or may not depending on which phone you get.
    In your example you state paying $25 for the "lease" this is assuming you want a $600 phone. You could pay that $200 as down payment lowering your Edge payment. With a sub 10 GB data plan yes it's basically a wash between a $600 phone on Edge or paying $200 and getting a 2 year contract. 10 GB or more you WILL save with Edge. With 4 lines you would get an additional $40 in Edge discounts per month, Depending on your data plan now it might be worth it to upgrade your data plan if it's under 10 GB.
    If your lines are off contract now and you are not in a hurry to upgrade you could be getting $25 off now. Assuming you have the 10 GB data plan. s fi you could afford to pay full price for your device upfront that might be the best way to go.
    Log into My Verizon click Change Features and you should see an option to activate a month to month discount

  • ServletExceptions I do not understand

    >
    500 Servlet Exception
    /~ppowell/includes/chat_messages.jsp:153: cannot find symbol
    symbol : constructor MessageProcessor(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,boolean)
    location: class ppowell.MessageProcessor
    MessageProcessor mp = new MessageProcessor(request, response, true); // THIRD PARAMETER MEANS YOU WILL GET HTML
    ^
    /~ppowell/includes/chat_messages.jsp:155: cannot find symbol
    symbol : method getHTML()
    location: class ppowell.MessageProcessor
    content = mp.getHTML();
    ^
    Note: /usr/local/resin2/work/__27eppowell/_includes/_chat_0messages__jsp.java
    uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    2 errors
    I am getting ServletException errors on a successfully-compiled class MessageProcessor (http://www.myjavaserver.com/~ppowell/docs/MessageProcessor.java ). I do not understand why I'm getting these errors, it's perfectly good syntax, I thought!
    package ppowell;
    import java.io.*;
    import java.util.*;
    import javax.servlet.*;
    import java.util.regex.*;
    import javax.servlet.http.*;
    * Serializable class to send message from applet or JSP received from ChatServlet to go to
    * the flat file referenced in ChatGlobals class.  Will immediately also receive all messages
    * from the flat file to return to the applet exclusively.  Will handle all commands using
    * MessageCenter class instance.
    * @version JSDK 1.4
    * @author Phil Powell
    * @package ppowell
    public class MessageProcessor implements Retriever, Serializable {
    //------------------------- --* PROPERTIES *-- -------------------------------
    public String message = "", origMessage = "", nickname = "";
    private NicknameBin nickBin;
    private HTMLEntities htmlEntities;
    private HTMLParser htmlParser;
    private URLParser urlParser;
    private MessageBinHashBundler bundler;
    private MessageConverter converter;
    private MessageCenter msgCenter;
    private MessageBin msgBin;
    private Pattern yourMessagePattern;
    private Matcher matcher;
    private String cookie = "", html = "", messageFromCommandResponse = "";
    private boolean isFoundNickname = false, isLastToLeave = false, isFromApplet = false, isOKPostMessage = true;
    private boolean isOKReceiveMessages = false, isOKReceiveNicks = false, isFromHTTP = false, willRetrieveHTML = false;
    private String[] convertedMsgArray, commandArray;
    private static final String redirectHTML = "";
    private Hashtable cookieHash = null;
    private HttpServletRequest request;
    private HttpServletResponse response;
    //------------------------- --* END OF PROPERTIES *-- -------------------------------
      * Constructor
      * @access public
    public MessageProcessor() {}                                        // CONSTRUCTOR
      * Constructor
      * @access public
      * @param HttpServletRequest request
      * @param HttpServletResponse response
    public MessageProcessor(HttpServletRequest request, HttpServletResponse response) {     // CONSTRUCTOR
      this.request = request;
      this.response = response;
      * Constructor
      * @access public
      * @param HttpServletRequest request
      * @param HttpServletResponse response
      * @param boolean willRetrieveHTML
      public MessageProcessor(HttpServletRequest request, HttpServletResponse response, boolean willRetrieveHTML) {
       this.request = request;
       this.response = response;
       this.willRetrieveHTML = willRetrieveHTML;
    }Ok, overloaded constructor, all is cool, so here are the offending scripts in chat_messages.jsp:
      MessageProcessor mp = new MessageProcessor(request, response, true);  // THIRD PARAMETER MEANS YOU WILL GET HTML
      mp.process();
      content = mp.getHTML();And here is the offending scripts in chat_nicknames.jsp:
       RequestParameterResetter request2 = new RequestParameterResetter(request);
       request2.setParameter("message", "/n");
       MessageProcessor mp = new MessageProcessor(request2, response, true);     // THIRD PARAMETER MEANS YOU WILL GET HTML
       mp.process();
       content = mp.getHTML();I am not understanding what is going on here and would love for some insight. Thanx
    Phil

    That was in Hungarian and I only speak English and
    Swedish.
    Nothing you said made any sense to me, sorry.
    All I did was add some lines and recompiled, FTP-ed
    it to the remote site and PRESTO it worked
    PhilAdding the main method did not do magic.
    Something else happened. Namely when you compiled and deployed (FTP) the first time something went wrong. Could be you didn't FTP the right file. Could be the server did not recognize it as new.
    So it 's possible that by adding A method you ended up doing a clean recompile and a clean deploy which rectified the problem.

  • Please Help me to understand something : |

    Subject:please Help me to understand something : |
    hi there ,
    so i know to create apps in flash cs5 , i downloaded the  adobe air 2.6 and installed . i downloaded Flash Professional CS5 Update 11.0.2 and Flash Professional CS5 Update for iOS
    10/11/2010.
    i read in adobe air 2.6 that it possible to make multitasking .
    2 questions :
    1.
    it possible to make multitasking in flash cs5 ( open apps on iphone , click on home button and when you come back ,  apps not restat ) ?
    i mean  play sound in my apps , and when you click on the home button the sound stay played.
    2.
    adobe air , when i installed it , it work on flash cs5 auto? i need to change somthing?
    in bigger , how i make multitasking in flash cs5?
    please help me
    thank you

    Not sure what you mean by the second question, but the answer your first; yes, air 2.6 allows for multitasking. You don't have to do anything to get this to work, it is setup by default.

  • Why is tabbed Finder useful? I do not understand the purpose

    I have used the Mac for many years, but do not understand why having tabs in the Finder is useful- can anyone explain why this is a big deal? The color tags also don't seem like it adds much, but I can at least understand the organizational logic.
    Why would someone open multiple Finder windows anyway?

    Fads, my friend, fads.  Someone at Apple wanted to get on the "tab" bandwagon and now they're trying to put tabs everywhere.  Even where it makes no sense at all and only complicates the user interface...
    Same thing with tags:  some people (Evernote, among others, is notable for refusing to allow more than two hierarchical levels) can't organize their documents in a hierarchical way.  Using nested folders, etc.
    They invented this "new" approach where you keep everything at the same hierarchical level, but add a (or several) flag to an item (file, folder) to make it a member of a "group".
    Same thing with the "look" of OS X.  There was the 3D epoch where the designers tended to make things stand out (icons, for example).  Now, we're entering the "flat look" epoch...
    Fads have a tendency to come and go.  In a while, we'll go on to something else, dreamed up be the latest "designer" to work on something...
    Bah...

  • [P67-GD65] OC CPU and voltage. After one year I still do not understand...

    It is "provoked" by this fantastic post:
    https://forum-en.msi.com/index.php?topic=157376.0
    Quote from: Bernhard on 03-March-12, 19:06:19
    My CPU is able to OC to 4,5 with all settings on Auto in the BIOS...
    2500K running 4500MHz 1,367V on "Auto"?  I can only dream about it and I am not talking about CPU but MB!
    My 2500K is running 4500MHz with "int. overvoltage" option enabled but I have to chose:
    1. set multi x45, CPU voltage to 1,340V, vdrop to auto - CPU-Z shows 1,384 running Prime - it`s ok IMHO, but no drop to low, idle voltage.
    2. set multi x45, CPU voltage to auto, vdrop to Low     - CPU-Z shows 1,424 running Prime -
    or
    3. set multi x42, CPU voltage to auto, vdrop to auto    - CPU-Z shows 1,280 running Prime - it`s ok
    I see from table that on 4100MHz Bernhard get (assuming "Auto") 1,352V! How? Maybe vdrop was set to "Low"(?) Heh... I get 1,408V with vdrop "Low" while running 4200MHz! It is the same as running auto OC Genie/Moron with button.
    In other words... I do not know what is so special with Bernhard's settings to get 1,376V running 4500MHz on "Auto". I know that test was on Z68 and using multimeter but is it possible that voltage oc settings are so different (means broken) on P67-GD65 or maybe it is just a simple user error on my side(?)

    Quote from: Jack on 07-April-12, 23:31:00
    Yes, that is possible and that does definately not mean something is broken.
    "Definately" is a rather strange word in my opinion. Please, do not get me wrong it is (again!) just my opinion. 
    Quote from: Bernhard on 08-April-12, 00:20:36
    I understand your question and possible frustration...
    Frustration? No, no, no! I am rather happy with my gaming rig I just want to know, understand more.
    So... Could You tell me your Vdroop setting? It is very strange that on "Auto" I get 1,280V (4200MHz, Prime blend, its ok) and You get 1,352V (IMHO too much without vdroop option) on 4100MHz. This is huge difference. Is it just a CPU batch difference? Mind You, when I switch vdroop to "Low" (I have only "Auto" and "Low" here) CPU voltage reading goes to 1,408V (4200MHz, way too much voltage!) testing Prime.
    BTW: Older P67-GD65 bioses have Auto, Low and High vdroop settings. AFAIR Low and High was the same. Am I wrong?

  • I ran a virus/trojan fix and this is what it said it could not repair something in the main library core or something like that.  What do I do?  The problem seems to be with safari?

    I ran a virus/trojan fix and this is what it said it could not repair something in the main library core or something like that.  What do I do?  The problem seems to be with safari?

    I ran the utility disk and this is what it said.
    Warning permission differ Applications/Safari drwxr-xrx they are -rwxr-xr system/livrary Cores has been modified and will not be repaired.
    Permission apllication differ on System/livrary/Pr or could be -rw-r--r-- they are rwxr-xr-x Application/iTune be droxr-xr-x they are rwxr-xr-x
    Then I hit fix permissions and it said this
    Warning SUID file Systm/Library/Core has been modified will not be repaired
    I also downloaded Bitdefender Virus Scanner and it found nothing.

  • My question is How to do old 4S to new 5 S to save same into phone but can not do ask someone last night and did not help me as I am deaf and not clear and Please man told me download from computer and I am not understand at all

    Yesterday We went to At and T store and they told me to download from old phone to new phone and I am really upset and I got Icloud and prove but part of still in 4S and has not go in 5S and that is biggest problem and no commuication that woman stay follow what she said but still not working so I do not know what else to do my do not understand and I would like to have someone do for us and AT and T store can not do that part so Told me Apple store and I called last night talk to some one on Apple store but told me that no go back to AT and T store so now total confuse and I am not get anywhere so and why they will not do it so therefore I do not think computer that not clear for us because we have no experince in computer program for this so both are deaf and not clear so over 50 years age and so we need face someone to do for us and told us do our self which is total upset us more so because my twins are in Orlando and can not call them because of problem contiunes in heart so I need someone who we can trust and help us. I do have IPAD mini and almost lost my calls to my twins and today I think get back but not 100 % so I am kind upset and who email us or I will have to go Apple Store and see if they know personal.

    Open this support document http://support.apple.com/kb/HT2109 print it from the computer and follow the steps there. You need to backup your data from the first device and then restore that to the new device.

  • HT204135 I update my Mac to version 10.9.2 and now my printer does not work anymore. I did all the software updates and I do not understand why my mac does not recognize the printer anymore?

    I update my Mac to version 10.9.2 and now my printer does not work anymore. I did all the software updates and I do not understand why my mac does not recognize the printer anymore?

    Go to the website of the manufacturer of your printer and check to see if they have released an updated driver for your particular model.

  • Users of imovie experience a lot of problems and crying for help and no one at Apple did not respond I do not understand how a company like Apple puts experts to help users Please note that anonymous experts in Internet offer their help for money

    Users of imovie experience a lot of problems and crying for help and no one at Apple did not respond
    I do not understand how a company like Apple puts experts to help users
    Please note that anonymous experts in Internet offer their help for money

    Users of imovie experience a lot of problems and crying for help and no one at Apple did not respond
    I do not understand how a company like Apple puts experts to help users
    Please note that anonymous experts in Internet offer their help for money

  • I can no longer access Bejeweled Blitz through my facebook account.  I get the message that says, "your browser sent a request that this server could not understand. Size of a request header field exceeds server limit".  Help please.

    I can no longer access Bejeweled Blitz through facebook.  I get the message, "your browser sent a request that this server could not understand. Size of a request header field exceeds server limit". I can access Bejeweled through FB using my husband's log in so to me that suggests the problem is with my log in. Help please.

    Contact FB or use another browser. 

Maybe you are looking for

  • Problem with the JDBC URL while creating a new connection pool

    Hi, I am trying to install soademo application in my desktop and was unable to create a connection pool. Test connection fails even though I have provided the correct values (I confirmed these values with tnsnames.ora file). Anyone has experienced th

  • How do I get this link to work???

    I would really like to view the following movie on my PC with Quicktime 7 and Windows XP Pro. I have even uninstalled and reinstalled Quicktime, but all I get is the faint Q with a question mark in it. Any help would be greatly appreciated. http://ww

  • Where can i buy a 62 cartridge for an envy5640 printer in sydney, australia

    Hello , I recently received a replacement printer from HP. I was told my current model was no longer manufactured and was provided with an HP Envy 5640 as a replacement. The initial cartridge that was provided with the printer has run out.  I am tryi

  • Urgent ! How to Zip Folder Contents including files and sub folders.

    Hi, i need an urgent help from you regarding zipping the contents of any folder/directory including its sub folders and files to a .zip file. Please provide a code for ot or help me out. It is really very urgent. Thanx Waiting....

  • Default date range of BBPCF02

    Folks - I am trying to find a simple way to change the default date range shown when the iview is called   - Currently that is "Last 7 days"  - User can use drop down to chsnge to "Last 30 days."  But, is there a way to change the default? SRM 5.0, i