• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Slight problem with deleting items from a scroller.

 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



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)
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ben Jass
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You've been asked before for a SSCCE. It's time you learn how to create one. Picture mean nothing.
 
Ben Jass
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rob +1
 
Ben Jass
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I understand, but it's over. No need to extend it.
 
pete stein
Bartender
Posts: 1561
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
We find this kind of rampant individuality very disturbing. But not this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic