• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

array question

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

I have an array chartable[][] and another one JButton[][]
Now the size of array and length of each element is given for chartable. How could I initiailse JButton that it can hold all the characters in chartable as new JButton(""+chartable[i][j]);

char chartable [][]={
arrays of variable lengths
}
JButton buttons=new JButton[chartable.length][?]

Thanx in Advance,

Maki Jav
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Example:buttons now refers to an array of length 5. Each cell in that atrray is null, so you will have to initialize them seperately, for example:
 
Maki Jav
Ranch Hand
Posts: 473
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
but what if we have

char chartable[][] = {
{0x0621, 0xFE80}, /* HAMZA */
{0x0622, 0xFE81, 0xFE82}, /* ALEF WITH MADDA ABOVE */
{0x0623, 0xFE83, 0xFE84}, /* ALEF WITH HAMZA ABOVE */
{0x0624, 0xFE85, 0xFE86}, /* WAW WITH HAMZA ABOVE */
{0x0625, 0xFE87, 0xFE88}, /* ALEF WITH HAMZA BELOW */
{0x0626, 0xFE89, 0xFE8A, 0xFE8B, 0xFE8C}, /* YEH WITH HAMZA ABOVE */
{0x0627, 0xFE8D, 0xFE8E}, /* ALEF */
{0x0628, 0xFE8F, 0xFE90, 0xFE91, 0xFE92}, /* BEH */
{0x0629, 0xFE93, 0xFE94} /* TEH MARBUTA */
}

ie the inner arrays vary...

How to initialize JButton [][] array appropriately?


Thanks,

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

Originally posted by Maki Jav:
but what if we have

char chartable[][] = {
{0x0621, 0xFE80}, /* HAMZA */
{0x0622, 0xFE81, 0xFE82}, /* ALEF WITH MADDA ABOVE */
{0x0623, 0xFE83, 0xFE84}, /* ALEF WITH HAMZA ABOVE */
{0x0624, 0xFE85, 0xFE86}, /* WAW WITH HAMZA ABOVE */
{0x0625, 0xFE87, 0xFE88}, /* ALEF WITH HAMZA BELOW */
{0x0626, 0xFE89, 0xFE8A, 0xFE8B, 0xFE8C}, /* YEH WITH HAMZA ABOVE */
{0x0627, 0xFE8D, 0xFE8E}, /* ALEF */
{0x0628, 0xFE8F, 0xFE90, 0xFE91, 0xFE92}, /* BEH */
{0x0629, 0xFE93, 0xFE94} /* TEH MARBUTA */
}

ie the inner arrays vary...

How to initialize JButton [][] array appropriately?


Thanks,

Maki Jav



How about:
 
Maki Jav
Ranch Hand
Posts: 473
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!


Maki Jav
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic