Las vistas fueron movidas con tal de conseguir un solo frame de programa y realizar todo el flujo dentro de el
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
package danielcortes.xyz.controllers;
|
||||
|
||||
import danielcortes.xyz.controllers.actions.BasicAction;
|
||||
import danielcortes.xyz.data.Configuration;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
class BaseController {
|
||||
static void moveTo(JComponent origin, JComponent destiny) {
|
||||
@@ -17,4 +19,14 @@ class BaseController {
|
||||
target.getInputMap(JComponent.WHEN_FOCUSED).put(keyStroke, name);
|
||||
target.getActionMap().put(name, action);
|
||||
}
|
||||
|
||||
private void launchFrame(JComponent view, String title, Dimension d){
|
||||
JFrame frame = new JFrame(title + ": " + Configuration.get("nombre_caja"));
|
||||
frame.setContentPane(view);
|
||||
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
||||
|
||||
frame.setSize(d);
|
||||
frame.setLocationRelativeTo(null);
|
||||
frame.setVisible(true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user