wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes JButton with bad Labels Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JButton with bad Labels" Watch "JButton with bad Labels" New topic
Author

JButton with bad Labels

Kevin Hamrick
Ranch Hand

Joined: Aug 30, 2004
Posts: 32
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

Joined: Sep 29, 2004
Posts: 113
invoke the toString() method of your array elements:



Just copy and past the code .
 
 
subject: JButton with bad Labels
 
Similar Threads
How to repaint/refresh/redraw JPanel
what i have done
how to create JButton Array
How to make an 'expandable' button-like component
what i have done