PDA

View Full Version : [Java] due domandine semplici semplici


carMAN
22-10-2003, 18:19
Ho da proporvi due domandine semplici semplici ma a cui non so dare una risposta!!!

1) Ho assegnato ad una JButton una immagine ma questa non riempie tutto il bottone. Praticamente intorno ad essa si forma una banda grigia che delimita il bottone . Come faccio a fare in modo che la mia immagine ricompra completamente il mio bottone?

2) Ho definito un' Applet ma non vorrei che sotto di essa comparisse la dicitura 'Applet avviato'

come devo fare?
grazie mille

soalle
22-10-2003, 19:08
Per il bottone prova a giocare con questo metodo:

setMargin

public void setMargin(Insets m)
Sets space for margin between the button's border and the label. Setting to null will cause the button to use the default margin. The button's default Border object will use this value to create the proper margin. However, if a non-default border is set on the button, it is that Border object's responsibility to create the appropriate margin space (else this property will effectively be ignored).

Parameters:
m - the space between the border and the label

di AbstractButton...
Settando gli insets tutti a zero dovresti ottenere quello che desideri...

Per quanto riguarda l'applet... non saprei... cosė a sentimento ti direi che non sia possibile...