• 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

Implementing Arrays in JDefaultListModel

 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
im trying to extend basic design of a console based system to a gui interface. I am having a problem with an array within an 'Account' class which stores details and amounts of accounts. The problem is: when i try and tie up the class which builds up the interface, panels, panes, container etc. to the 'Account' class it cannot pass the info properly. I have looked at numerous examples of swing and AWT but cannot see examples of pluggin in other classes!
please any advice would help!
Cheers James
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not very sure what your exact problem is, but I am supposing that when you add your Account object to the list through some list modal, the info contained in the account object is not showing correctly. I think one solution can be overwrite the Account class's toString method, use that to return whatever info you want to show on the list, hope that helps your problem.
code sample:
public String toString()
{
return "Account: " + acctId + " Amount: $" + acctAmt;
}

Originally posted by James Lechte:
Hi all,
im trying to extend basic design of a console based system to a gui interface. I am having a problem with an array within an 'Account' class which stores details and amounts of accounts. The problem is: when i try and tie up the class which builds up the interface, panels, panes, container etc. to the 'Account' class it cannot pass the info properly. I have looked at numerous examples of swing and AWT but cannot see examples of pluggin in other classes!
please any advice would help!
Cheers James


 
I didn't say it. I'm just telling you what this tiny ad said.
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