• Post Reply Bookmark Topic Watch Topic
  • New Topic

Lists and GUI  RSS feed

 
Marin IvandiC
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

I have questions about working with lists,

I write my da ta with composits blocks in GUI, but now when i dispose one of the block i need to make that block that is below the block that i dispose dynamically change position..Now if i have 4 blocks, and I'm deleting second block, I want to make that block 3 and 4 come on the position 2 and 3 because when i delete block 2 on his position is empty space..
 
Tapas Chand
Ranch Hand
Posts: 614
9
BSD Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the code and explain what difficulty you are facing.
 
Marin IvandiC
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is part of my code for writing blocks,

problem is when i want to remove one of the blocks i get empty space on his position, I want to make that when i remove block everything that is in the list is going to change position dynamically..

 
Tim Harris
Ranch Hand
Posts: 57
3
Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only way I can really think to do it is to iterate back through your list every time you remove a student, and basically re-do the blocks on the screen.

Removing an element only does just that - removes the current component. You have to tell it that you want to redo the graphical components.
 
Campbell Ritchie
Sheriff
Posts: 53779
128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Go through the Java™ Tutorials. You might be able to link your List (datastructure) to a List (display) or a Table (display) so changes to the datastructure are reflected in the display.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!