PDA

View Full Version : [JAVA/Swing] JFileChooser e testo Cancel


lovaz
23-02-2007, 11:17
Esiste un modo per settare il testo e il tooltip del pulsante Cancel di un JFileChooser?

Grazie.

cuoricinoblu
23-02-2007, 13:37
Potresti usare UIManager, un esempio veloce:

import javax.swing.*;

public class TestClass extends JFrame
{
public TestClass()
{
UIManager.put("FileChooser.cancelButtonText", "Scancella");
UIManager.put("FileChooser.cancelButtonToolTipText", "Questo bottone scancella la tua azione");
JFileChooser fc = new JFileChooser();
fc.showOpenDialog(this);
System.exit(0);
}

public static void main(String[] args) {
TestClass tc = new TestClass();
}
}

Ciao :D

lovaz
23-02-2007, 13:48
Grazie, funziona.

Certo che potevano pure mettere due metodini nella classe JFileChooser!

Ciao.

cuoricinoblu
23-02-2007, 13:52
Uh.... troppo difficile ;)
poverini, si sarebbero potuti sbucciare i polpastrelli aggiungendo 2 metodi :)