aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Slight problem with deleting items from a scroller. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Slight problem with deleting items from a scroller." Watch "Slight problem with deleting items from a scroller." New topic
Author

Slight problem with deleting items from a scroller.

Ben Jass
Ranch Hand

Joined: Sep 25, 2010
Posts: 76



In the picture above, I'll manually delete one of the values from the list by clicking the delete button, only when there are so so many values that it makes the scroller on the side, it does it not work. When there are only 5 values, it deletes fine, and updates perfectly. When there are any more then that, it deletes a value at random?

convertInt.remove(correctOrderText.getSelectedIndex());

Thats the one line of code that removes it from the ArrayList (convertInt) by getting it from the selection of the JList (correctOrderText)
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9990
    
    7

We are expected to tell you what the problem is looking at the screenshot?
You can help us help you by posting your SSCCE code


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Ben Jass
Ranch Hand

Joined: Sep 25, 2010
Posts: 76
I honestly don't know what else to tell you..the screenshot was to give you a visual. When I click the delete button it activates the actionListener and does this code:


Umm..if you want the JList code here it is:

setNumberOrder method:



setListArea Method:





I honestly don't know what else to give you
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2091
    
    7
You've been asked before for a SSCCE. It's time you learn how to create one. Picture mean nothing.
Ben Jass
Ranch Hand

Joined: Sep 25, 2010
Posts: 76
Call me greedy, but why make one when I gave you all the info someone would need for this problem above? That's all that deals with the issue.
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2091
    
    7
You have a problem you can't solve, so you don't know what is necessary to solve the problem. That is why you create a SSCCE. To simplify the problem to help you understand it better and to save us time so we don't have to look at irrelevant lines of code.

If you make an effort, we will make an effort.

You've already been given a working example (you're welcome by the way). So really its up to you to see what is different between your code and the working code.
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9990
    
    7

Rob +1
Ben Jass
Ranch Hand

Joined: Sep 25, 2010
Posts: 76
Again, I posted all the code above that someone would need to solve the problem, I don't see why I would need to go much further, call me lazy, but there's not point..doesn't matter now though, I solved it. I'm not trying to be rude, and I apologize if you have taken me the wrong way.
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2091
    
    7
Again, I posted all the code above that someone would need to solve the problem,


No you didn't!!!

We know nothing about the context of when/how that code is used. Many times people have problems because they define class and local variable for the same GUI component. There are so many silly mistakes that can be made that we can't see when you post random lines of code that may or may not be related to the problem.

doesn't matter now though, I solved it.


See I'm sure it was a silly problem that was easily solved when you took a closer look at the problem when we asked you to post a SSCCE.
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
Ben Jass wrote: Again, I posted all the code above that someone would need to solve the problem, I don't see why I would need to go much further, call me lazy, but there's not point..doesn't matter now though, I solved it. I'm not trying to be rude, and I apologize if you have taken me the wrong way.


Let's not argue here since that's obviously not achieving anything, and you certainly aren't required to create an SSCCE, and no one is able to force you to do this, but as yet, no one has posted a solution to your question in the forum (even if you have solved it yourself), and maybe this is due to our not having enough information to allow us to create a solution in a reasonable period of time to expect a volunteer to commit. Please understand that to solve complex problems, we often have to create the SSCCE ourselves, and your creating it for us makes it much easier for us to understand your problem, test it, modify it, and correct it. The bottom line as I see it is if you want a correct solution quickly, then it's undoubtedly in your best interest to create and post an SSCCE. I think I speak for all in saying that if you put in the effort to create this, we would all appreciate it, and we would likely show our appreciation in trying to help you as much as possible.

Cheers.
Ben Jass
Ranch Hand

Joined: Sep 25, 2010
Posts: 76
I understand, but it's over. No need to extend it.
pete stein
Bartender

Joined: Feb 23, 2007
Posts: 1561
Ben Jass wrote: I understand, but it's over. No need to extend it.


The current issue is over for you as you've answered your question, and I am truly glad for you, but this issue is also one commonly encountered by others here in the forum, and so I felt my points important enough to make if only for them.

Best of luck.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Slight problem with deleting items from a scroller.
 
Similar Threads
is this design OK?
DELETE statement deletes record but returns 0
java.sql.BatchUpdateException: ORA-02049
delete cookie from request ?
Cookies are not deleting