Si, grazie, il problema è che non riesco a capire come fare, riporto uno stralcio del tutto nella speranza che qualcuno mi illumini.Originariamente inviato da Rubox
.. il quale avrà anche un BlablablaView, da cui puoi ricavare il JFrame...![]()
File di avvio dell'applicazione:
Codice PHP:public class GestioneBrevettiApp extends SingleFrameApplication {
/**
* At startup create and show the main frame of the application.
*/
@Override protected void startup() {
show(new GestioneBrevettiView(this));
}
/**
* This method is to initialize the specified window by injecting resources.
* Windows shown in our application come fully initialized from the GUI
* builder, so this additional configuration is not needed.
*/
@Override protected void configureWindow(java.awt.Window root) {
}
/**
* A convenient static getter for the application instance.
* @return the instance of GestioneBrevettiApp
*/
public static GestioneBrevettiApp getApplication() {
return Application.getInstance(GestioneBrevettiApp.class);
}
/**
* Main method launching the application.
*/
public static void main(String[] args) {
launch(GestioneBrevettiApp.class, args);
}
}
File di View dell'applicazione:
Classe: public class GestioneBrevettiView extends FrameView {
Codice PHP:public GestioneBrevettiView(SingleFrameApplication app) {
super(app);
initComponents();
// status bar initialization - message timeout, idle icon and busy animation, etc
ResourceMap resourceMap = getResourceMap();
int messageTimeout = resourceMap.getInteger("StatusBar.messageTimeout");
messageTimer = new Timer(messageTimeout, new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});
messageTimer.setRepeats(false);
int busyAnimationRate = resourceMap.getInteger("StatusBar.busyAnimationRate");
for (int i = 0; i < busyIcons.length; i++) {
busyIcons[i] = resourceMap.getIcon("StatusBar.busyIcons[" + i + "]");
}
busyIconTimer = new Timer(busyAnimationRate, new ActionListener() {
public void actionPerformed(ActionEvent e) {
busyIconIndex = (busyIconIndex + 1) % busyIcons.length;
}
});
idleIcon = resourceMap.getIcon("StatusBar.idleIcon");
// connecting action tasks to status bar via TaskMonitor
TaskMonitor taskMonitor = new TaskMonitor(getApplication().getContext());
taskMonitor.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
public void propertyChange(java.beans.PropertyChangeEvent evt) {
String propertyName = evt.getPropertyName();
if ("started".equals(propertyName)) {
if (!busyIconTimer.isRunning()) {
busyIconIndex = 0;
busyIconTimer.start();
}
} else if ("done".equals(propertyName)) {
busyIconTimer.stop();
} else if ("message".equals(propertyName)) {
String text = (String) (evt.getNewValue());
messageTimer.restart();
}
}
});
}



Rispondi quotando