Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JButton with bad Labels

 
Kevin Hamrick
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I loop through and make some JButtons but they don't display the correct names. Here is what is showing on each button.
javax.swing.JButton[,0,0,0x0,invalid,layout=javax.swing.OverlayLayout,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@109fd93,flags=296,maximumSize=,minimumSize=,preferredSize=,defaultIcon=,disabledIcon=,disabledSelectedIcon=,margin=javax.swing.plaf.InsetsUIResource[top=2,left=14,bottom=2,right=14],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=MISSION,defaultCapable=true]
and here is the code

As you can see i've done a lot of debugging and trying different approaches but nothing works. All I want are these buttons in the header of my JTable with the specified labels.
P.S. Swing is new to me, if someone could recommend a good reference that would be great.
 
jefff willis
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
invoke the toString() method of your array elements:



Just copy and past the code .
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic