示例#1
0
 public static void main(String args[]) {
   try {
     for (javax.swing.UIManager.LookAndFeelInfo info :
         javax.swing.UIManager.getInstalledLookAndFeels()) {
       if ("Nimbus".equals(info.getName())) {
         javax.swing.UIManager.setLookAndFeel(info.getClassName());
         break;
       }
     }
   } catch (ClassNotFoundException
       | InstantiationException
       | IllegalAccessException
       | javax.swing.UnsupportedLookAndFeelException ex) {
     java.util.logging.Logger.getLogger(Options.class.getName())
         .log(java.util.logging.Level.SEVERE, null, ex);
   }
   /* Create and display the form */
   java.awt.EventQueue.invokeLater(
       new Runnable() {
         @Override
         public void run() {
           new Options().setVisible(true);
         }
       });
 }
示例#2
0
  /** @param args the command line arguments */
  public static void main(String args[]) {
    /* Set the Nimbus look and feel */
    // <editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
    /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
     * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
     */
    try {
      for (javax.swing.UIManager.LookAndFeelInfo info :
          javax.swing.UIManager.getInstalledLookAndFeels()) {
        if ("Nimbus".equals(info.getName())) {
          javax.swing.UIManager.setLookAndFeel(info.getClassName());
          break;
        }
      }
    } catch (ClassNotFoundException ex) {
      java.util.logging.Logger.getLogger(ManageAcces.class.getName())
          .log(java.util.logging.Level.SEVERE, null, ex);
    } catch (InstantiationException ex) {
      java.util.logging.Logger.getLogger(ManageAcces.class.getName())
          .log(java.util.logging.Level.SEVERE, null, ex);
    } catch (IllegalAccessException ex) {
      java.util.logging.Logger.getLogger(ManageAcces.class.getName())
          .log(java.util.logging.Level.SEVERE, null, ex);
    } catch (javax.swing.UnsupportedLookAndFeelException ex) {
      java.util.logging.Logger.getLogger(ManageAcces.class.getName())
          .log(java.util.logging.Level.SEVERE, null, ex);
    }
    // </editor-fold>

    /* Create and display the form */
    java.awt.EventQueue.invokeLater(
        () -> {
          new ManageAcces().setVisible(true);
        });
  }
示例#3
0
 public static void setPLAF(String s) {
   try {
     if (s.equals("TinyLAF")) {
       javax.swing.UIManager.setLookAndFeel("de.muntjak.tinylookandfeel.TinyLookAndFeel");
     } else if (s.equals("JGoodiesLAF-PlasticXP")) {
       javax.swing.UIManager.setLookAndFeel("com.jgoodies.plaf.plastic.PlasticXPLookAndFeel");
     } else if (s.equals("JGoodiesLAF-Plastic")) {
       javax.swing.UIManager.setLookAndFeel("com.jgoodies.plaf.plastic.PlasticLookAndFeel");
     } else if (s.equals("JGoodiesLAF-Plastic3D")) {
       javax.swing.UIManager.setLookAndFeel("com.jgoodies.plaf.plastic.Plastic3DLookAndFeel");
     } else if (s.equals("JGoodiesLAF-ExtWindows")) {
       javax.swing.UIManager.setLookAndFeel("com.jgoodies.plaf.windows.ExtWindowsLookAndFeel");
     } else if (s.equals("System")) {
       javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
     } else {
       javax.swing.UIManager.LookAndFeelInfo[] lfinfo =
           javax.swing.UIManager.getInstalledLookAndFeels();
       for (int i = 0; i < lfinfo.length; ++i) {
         if (lfinfo[i].getName().equalsIgnoreCase(s)) {
           javax.swing.UIManager.setLookAndFeel(lfinfo[i].getClassName());
           return;
         }
       }
     }
   } catch (Exception ex) {
     ex.printStackTrace();
   }
 }
 public static void main(String[] args) {
   try {
     javax.swing.UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
   } catch (Exception e) {
     e.printStackTrace();
   }
   BSInterface bs = new BSInterface();
 }
示例#5
0
 public static void setLookAndFeel(String name) {
   try {
     if (name.equals("PGS")) {
       UIManager.setLookAndFeel("com.pagosoft.plaf.PgsLookAndFeel");
     } else {
       for (javax.swing.UIManager.LookAndFeelInfo info :
           javax.swing.UIManager.getInstalledLookAndFeels()) {
         if (name.equals(info.getName())) {
           javax.swing.UIManager.setLookAndFeel(info.getClassName());
           break;
         }
       }
     }
   } catch (ClassNotFoundException
       | InstantiationException
       | IllegalAccessException
       | javax.swing.UnsupportedLookAndFeelException ex) {
     java.util.logging.Logger.getLogger(Launcher.class.getName())
         .log(java.util.logging.Level.SEVERE, null, ex);
   }
 }
示例#6
0
  // ErtanO 12.03.2004
  public static java.util.List getAvailablePLAF() {
    java.util.List l = new java.util.ArrayList();
    l.add("System");
    l.add("TinyLAF");
    l.add("JGoodiesLAF-PlasticXP");
    l.add("JGoodiesLAF-Plastic");
    l.add("JGoodiesLAF-Plastic3D");
    l.add("JGoodiesLAF-ExtWindows");

    javax.swing.UIManager.LookAndFeelInfo[] lfinfo =
        javax.swing.UIManager.getInstalledLookAndFeels();

    for (int i = 0; i < lfinfo.length; ++i) {
      l.add(lfinfo[i].getName());
    }

    return l;
  }
  protected ToolTipAttributes getSystemLookAndFeelAttributes() {
    Font font = UIManager.getFont("ToolTip.font");
    Color textColor = UIManager.getColor("ToolTip.foreground");
    Color interiorColor = UIManager.getColor("ToolTip.background");
    Color outlineColor = javax.swing.UIManager.getColor("ToolTip.foreground");
    double textOpacity = this.getOpacity();
    double interiorOpacity = this.getOpacity();
    double outlineOpacity = this.getOpacity();
    double outlineWidth = this.getOutlineWidth();
    Insets insets = null;

    Border border = UIManager.getBorder("ToolTip.border");
    if (border instanceof LineBorder) // Implicitly checks for non-null.
    {
      outlineColor = ((LineBorder) border).getLineColor();
      outlineWidth = ((LineBorder) border).getThickness();
    }

    if (border != null) insets = border.getBorderInsets(null);

    if (font == null) font = this.getFont();

    if (textColor == null) textColor = this.getTextColor();

    if (interiorColor == null) interiorColor = this.getInteriorColor();

    if (outlineColor == null) outlineColor = this.getOutlineColor();

    if (insets == null) insets = this.getInsets();

    return new ToolTipAttributes(
        font,
        textColor,
        interiorColor,
        outlineColor,
        textOpacity,
        interiorOpacity,
        outlineOpacity,
        outlineWidth,
        insets);
  }
示例#8
0
 static {
   try {
     javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());
   } catch (Exception e) {
   }
 }
/**
 * A Control that shows its parameters in a JTable. Custom bottons can be added.
 *
 * @author Wolfgang Christian
 * @version 1.0
 */
public class OSPControl extends ControlFrame implements PropertyChangeListener, MainFrame {
  OSPControlTable table = new OSPControlTable(new XMLControlElement());
  JScrollPane controlScrollPane = new JScrollPane(table);
  JTextArea messageTextArea;
  JLabel clearLabel, messageLabel, inputLabel;
  JSplitPane splitPane;
  JMenuItem translateItem;
  static final Color PANEL_BACKGROUND =
      javax.swing.UIManager.getColor("Panel.background"); // $NON-NLS-1$

  /**
   * Constructs an OSPControl.
   *
   * @param _model
   */
  public OSPControl(Object _model) {
    super(ControlsRes.getString("OSPControl.Default_Title")); // $NON-NLS-1$
    model = _model;
    if (model != null) {
      // added by D Brown 2006-09-10
      // modified by D Brown 2007-10-17
      if (OSPRuntime.translator != null) OSPRuntime.translator.associate(this, model.getClass());
      String name = model.getClass().getName();
      setTitle(
          name.substring(1 + name.lastIndexOf("."))
              + ControlsRes.getString("OSPControl.Controller")); // $NON-NLS-1$ //$NON-NLS-2$
    }
    ToolsRes.addPropertyChangeListener("locale", this);
    Font labelFont = new Font("Dialog", Font.BOLD, 12); // $NON-NLS-1$
    inputLabel =
        new JLabel(
            ControlsRes.getString("OSPControl.Input_Parameters"),
            SwingConstants.CENTER); // $NON-NLS-1$
    inputLabel.setFont(labelFont);
    messageTextArea = new JTextArea(5, 5);
    JScrollPane messageScrollPane = new JScrollPane(messageTextArea);
    // contains a view of the control
    JPanel topPanel = new JPanel(new BorderLayout());
    topPanel.add(inputLabel, BorderLayout.NORTH);
    topPanel.add(controlScrollPane, BorderLayout.CENTER);
    buttonPanel.setVisible(true);
    topPanel.add(buttonPanel, BorderLayout.SOUTH); // buttons are added using addButton method.
    // clear panel acts like a button to clear the message area
    JPanel clearPanel = new JPanel(new BorderLayout());
    clearPanel.addMouseListener(new ClearMouseAdapter());
    clearLabel = new JLabel(ControlsRes.getString("OSPControl.Clear")); // $NON-NLS-1$
    clearLabel.setFont(new Font(clearLabel.getFont().getFamily(), Font.PLAIN, 9));
    clearLabel.setForeground(Color.black);
    clearPanel.add(clearLabel, BorderLayout.WEST);
    // contains the messages
    JPanel bottomPanel = new JPanel(new BorderLayout());
    messageLabel =
        new JLabel(
            ControlsRes.getString("OSPControl.Messages"), SwingConstants.CENTER); // $NON-NLS-1$
    messageLabel.setFont(labelFont);
    bottomPanel.add(messageLabel, BorderLayout.NORTH);
    bottomPanel.add(messageScrollPane, BorderLayout.CENTER);
    bottomPanel.add(clearPanel, BorderLayout.SOUTH);
    Container cp = getContentPane();
    splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, topPanel, bottomPanel);
    splitPane.setOneTouchExpandable(true);
    cp.add(splitPane, BorderLayout.CENTER);
    messageTextArea.setEditable(false);
    controlScrollPane.setPreferredSize(new Dimension(350, 200));
    controlScrollPane.setMinimumSize(new Dimension(0, 50));
    messageScrollPane.setPreferredSize(new Dimension(350, 75));
    if (OSPRuntime.translator != null && model != null) {
      OSPRuntime.translator.associate(table, model.getClass());
    }
    Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    setLocation(
        (d.width - getSize().width) / 2, (d.height - getSize().height) / 2); // center the frame
    init();
  }

  /**
   * Gets this frame. Implementation of MainFrame interface.
   *
   * @return OSPFrame
   */
  public OSPFrame getMainFrame() {
    return this;
  }

  /**
   * Adds a Display menu to the menu bar. Overrides OSPFrame method.
   *
   * @return the display menu
   */
  protected JMenu loadDisplayMenu() {
    JMenuBar menuBar = getJMenuBar();
    if (menuBar == null) {
      return null;
    }
    JMenu menu = super.loadDisplayMenu();
    translateItem = new JMenuItem();
    translateItem.setText(ControlsRes.getString("OSPControl.Translate")); // $NON-NLS-1$
    // changed by D Brown 2007-10-17
    if (OSPRuntime.translator != null) {
      translateItem.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              OSPRuntime.translator.showProperties(model.getClass());
              if (OSPRuntime.translator instanceof Hidable)
                ((Hidable) OSPRuntime.translator).setKeepHidden(false);
              OSPRuntime.translator.setVisible(true);
            }
          });
      translateItem.setEnabled(OSPRuntime.isAuthorMode());
      languageMenu.add(translateItem, 0);
    }
    // changed by D Brown 2006-09-10
    if (languageMenu.getItemCount() > 1) languageMenu.insertSeparator(1);
    return menu;
  }

  /** Refreshes the user interface in response to display changes such as Language. */
  protected void refreshGUI() {
    super.refreshGUI();
    messageLabel.setText(ControlsRes.getString("OSPControl.Messages"));
    clearLabel.setText(ControlsRes.getString("OSPControl.Clear"));
    inputLabel.setText(ControlsRes.getString("OSPControl.Input_Parameters"));
    table.refresh();
  }

  /**
   * Listens for property change events.
   *
   * @param e the property change event
   */
  public void propertyChange(PropertyChangeEvent e) {
    String name = e.getPropertyName();
    if (name.equals("translation") || name.equals("locale")) refreshGUI();
    // forward event to other listeners
    else firePropertyChange(e.getPropertyName(), e.getOldValue(), e.getNewValue());
  }

  /**
   * Initializes this control after all objects have been created.
   *
   * <p>Override this method and change the default close operation if this control is used with an
   * applet.
   */
  protected void init() {
    splitPane.setDividerLocation(-1);
    setVisible(true);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  }

  public Object getModel() {
    return model;
  }

  /**
   * Sets the location of the divider between the control table and the message panel.
   *
   * @param loc int
   */
  public void setDividerLocation(int loc) {
    splitPane.setDividerLocation(loc);
  }

  /**
   * Sets the editable property of the given parameter so that it can not be changed from within the
   * GUI.
   *
   * @param parameter String
   * @param editable boolean
   */
  public void setEditable(String parameter, boolean editable) {
    table.setEditable(parameter, editable);
  }

  /**
   * Locks the control's interface. Values sent to the control will not update the display until the
   * control is unlocked.
   *
   * @param lock boolean
   */
  public void setLockValues(boolean lock) {
    table.setLockValues(true);
  }

  /**
   * Creates a string representation of the control parameters.
   *
   * @return the control parameters
   */
  public String toString() {
    return table.toString();
  }

  /**
   * Adds a parameter to the input display.
   *
   * @param par the parameter name
   * @param val the initial parameter value
   */
  public void setValue(String par, Object val) {
    table.setValue(par, val);
  }

  /**
   * Adds an initial boolean value of a parameter to the input display.
   *
   * @param par the parameter name
   * @param val the initial parameter value
   */
  public void setValue(String par, boolean val) {
    table.setValue(par, val);
  }

  /**
   * Adds an initial value of a parameter to the input display.
   *
   * @param par the parameter name
   * @param val the initial parameter value
   */
  public void setValue(String par, double val) {
    table.setValue(par, Double.toString(val));
  }

  /**
   * Adds an initial value of a parameter to the input display.
   *
   * @param par the parameter name
   * @param val the initial parameter value
   */
  public void setValue(String par, int val) {
    table.setValue(par, Integer.toString(val));
  }

  /**
   * Removes a parameter from the table.
   *
   * @param par the parameter name
   */
  public void removeParameter(String par) {
    table.setValue(par, null);
  }

  /**
   * Reads a parameter value from the input display.
   *
   * @param par
   * @return double the value of of the parameter
   */
  public double getDouble(String par) {
    return table.getDouble(par);
  }

  /**
   * Reads a parameter value from the input display.
   *
   * @param par
   * @return int the value of of the parameter
   */
  public int getInt(String par) {
    return table.getInt(par);
  }

  /**
   * Gets the object with the specified property name. Throws an UnsupportedOperationException if
   * the named object has not been stored.
   *
   * @param par
   * @return the object
   */
  public Object getObject(String par) throws UnsupportedOperationException {
    return table.getObject(par);
  }

  /**
   * Reads a parameter value from the input display.
   *
   * @param par the parameter name
   * @return String the value of of the parameter
   */
  public String getString(String par) {
    return table.getString(par);
  }

  /**
   * Reads a parameter value from the input display.
   *
   * @param par the parameter name
   * @return the value of of the parameter
   */
  public boolean getBoolean(String par) {
    return table.getBoolean(par);
  }

  /**
   * Reads the current property names.
   *
   * @return the property names
   */
  public Collection getPropertyNames() {
    return table.getPropertyNames();
  }

  /**
   * Adds a custom button to the control's frame.
   *
   * @param methodName the name of the method; the method has no parameters
   * @param text the button's text label
   * @return the custom button
   */
  public JButton addButton(String methodName, String text) {
    return addButton(methodName, text, null, model);
  }

  /**
   * Adds a custom button to the control's frame.
   *
   * @param methodName the name of the method; the method has no parameters
   * @param text the button's text label
   * @param toolTipText the button's tool tip text
   * @return the custom button
   */
  public JButton addButton(String methodName, String text, String toolTipText) {
    return addButton(methodName, text, toolTipText, model);
  }

  /**
   * Adds a ControlTableListener that invokes method in the control's model. The method in the model
   * is invoked with the table's variable name passed as a parameter.
   *
   * @param methodName the name of the method; the method has no parameters
   */
  public void addControlListener(String methodName) {
    addControlListener(methodName, model);
  }

  /**
   * Adds a ControlTableListener that invokes method in the given object. The method in the target
   * is invoked with the table's variable name passed as a parameter.
   *
   * @param methodName the name of the method; the method has no parameters
   * @param target the target for the method
   */
  public void addControlListener(String methodName, final Object target) {
    Class[] parameters = new Class[] {String.class};
    try {
      final java.lang.reflect.Method m = target.getClass().getMethod(methodName, parameters);
      table.tableModel.addTableModelListener(
          new TableModelListener() {
            public void tableChanged(TableModelEvent e) {
              if (e.getType() != TableModelEvent.UPDATE
                  || e.getColumn() != 1
                  || e.getFirstRow() < 0) {
                return;
              }
              String name = table.getValueAt(e.getFirstRow(), 0).toString();
              Object[] args = {name};
              try {
                m.invoke(target, args);
              } catch (IllegalAccessException iae) {
              } catch (java.lang.reflect.InvocationTargetException ite) {
              }
            }
          });
    } catch (NoSuchMethodException nsme) {
      System.err.println(
          "The method " + methodName + "() does not exist."); // $NON-NLS-1$ //$NON-NLS-2$
    }
  }

  /**
   * Prints a line of text in the message area.
   *
   * @param s
   */
  public void println(String s) {
    print(s + "\n"); // $NON-NLS-1$
  }

  /** Prints a blank line in the message area. */
  public void println() {
    print("\n"); // $NON-NLS-1$
  }

  /**
   * Prints text in the message area.
   *
   * @param s
   */
  public void print(final String s) {
    if (SwingUtilities.isEventDispatchThread()
        || Thread.currentThread().getName().equals("main")) { // $NON-NLS-1$
      messageTextArea.append(s);
      return;
    }
    Runnable doLater =
        new Runnable() {
          public void run() {
            messageTextArea.append(s);
          }
        };
    // Update from the event queue.
    java.awt.EventQueue.invokeLater(doLater);
  }

  /** Remove all text from the message area. */
  public void clearMessages() {
    if (SwingUtilities.isEventDispatchThread()
        || Thread.currentThread().getName().equals("main")) { // $NON-NLS-1$
      messageTextArea.setText(""); // $NON-NLS-1$
      return;
    }
    Runnable doLater =
        new Runnable() {
          public void run() {
            messageTextArea.setText(""); // $NON-NLS-1$
          }
        };
    // Update from the event queue.
    java.awt.EventQueue.invokeLater(doLater);
  }

  /** Remove all text from the data input area. */
  public void clearValues() {
    table.clearValues();
  }

  /**
   * A signal that a method has completed. A message is printed in the message area.
   *
   * @param message
   */
  public void calculationDone(String message) {
    // not implemented
    if (message != null) println(message);
  }

  class ClearMouseAdapter extends java.awt.event.MouseAdapter {

    /**
     * Method mousePressed
     *
     * @param evt
     */
    public void mousePressed(java.awt.event.MouseEvent evt) {
      clearMessages();
    }

    /**
     * Method mouseEntered
     *
     * @param evt
     */
    public void mouseEntered(java.awt.event.MouseEvent evt) {
      clearLabel.setFont(new Font(clearLabel.getFont().getFamily(), Font.BOLD, 10));
      clearLabel.setText(ControlsRes.getString("OSPControl.Click_to_clear_message")); // $NON-NLS-1$
    }

    /**
     * Method mouseExited
     *
     * @param evt
     */
    public void mouseExited(java.awt.event.MouseEvent evt) {
      clearLabel.setFont(new Font(clearLabel.getFont().getFamily(), Font.PLAIN, 9));
      clearLabel.setText(ControlsRes.getString("OSPControl.Clear")); // $NON-NLS-1$
    }
  }

  /**
   * Returns an XML.ObjectLoader to save and load data for this object.
   *
   * @return the object loader
   */
  public static XML.ObjectLoader getLoader() {
    return new OSPControlLoader();
  }

  /** A class to save and load data for OSPControls. */
  static class OSPControlLoader implements XML.ObjectLoader {

    /**
     * Saves object data to an XMLControl.
     *
     * @param control the control to save to
     * @param obj the object to save
     */
    public void saveObject(XMLControl xmlControl, Object obj) {
      OSPControl ospControl = (OSPControl) obj;
      saveControlProperites(xmlControl, ospControl);
      // save the model if the control is the top level
      if (xmlControl.getLevel() == 0) {
        xmlControl.setValue("model", ospControl.model); // $NON-NLS-1$
      }
    }

    protected void saveControlProperites(XMLControl xmlControl, OSPControl ospControl) {
      // save the parameters
      Iterator it = ospControl.getPropertyNames().iterator();
      while (it.hasNext()) {
        String name = (String) it.next();
        Object val = ospControl.getObject(name);
        if (val.getClass() == DoubleArray.class) {
          xmlControl.setValue(name, ((DoubleArray) val).getArray());
        } else if (val.getClass() == IntegerArray.class) {
          xmlControl.setValue(name, ((IntegerArray) val).getArray());
        } else if (val.getClass() == Boolean.class) {
          xmlControl.setValue(name, ((Boolean) val).booleanValue());
        } else if (val.getClass() == Double.class) {
          xmlControl.setValue(name, ((Double) val).doubleValue());
        } else if (val.getClass() == Integer.class) {
          xmlControl.setValue(name, ((Integer) val).intValue());
        } else if (val.getClass().isArray()) {
          xmlControl.setValue(name, val);
        } else {
          xmlControl.setValue(name, val);
        }
        // xmlControl.setValue(name, val.toString());
      }
    }

    /**
     * Creates an object using data from an XMLControl.
     *
     * @param control the control
     * @return the newly created object
     */
    public Object createObject(XMLControl control) {
      return new OSPControl(null);
    }

    /**
     * Loads an object with data from an XMLControl.
     *
     * @param control the control
     * @param obj the object
     * @return the loaded object
     */
    public Object loadObject(XMLControl control, Object obj) {
      OSPControl cf = (OSPControl) obj;
      // iterate over properties and add them to table model
      Iterator it = control.getPropertyNames().iterator();
      cf.table.setLockValues(true);
      while (it.hasNext()) {
        String name = (String) it.next();
        // skip "model" object properties
        if (name.equals("model") && control.getPropertyType(name).equals("object")) {
          XMLControl child = control.getChildControl("model"); // $NON-NLS-1$
          cf.model = child.loadObject(cf.model);
          continue;
        }
        if (control.getPropertyType(name).equals("string")) { // $NON-NLS-1$
          cf.setValue(name, control.getString(name));
        } else if (control.getPropertyType(name).equals("int")) { // $NON-NLS-1$
          cf.setValue(name, control.getInt(name));
        } else if (control.getPropertyType(name).equals("double")) { // $NON-NLS-1$
          cf.setValue(name, control.getDouble(name));
        } else if (control.getPropertyType(name).equals("boolean")) { // $NON-NLS-1$
          cf.setValue(name, control.getBoolean(name));
        } else {
          cf.setValue(name, control.getObject(name));
        }
      }
      cf.table.setLockValues(false);
      //      XMLControl child = control.getChildControl("model"); //$NON-NLS-1$
      //      if(child!=null) {
      //        cf.model = child.loadObject(cf.model);
      //      }
      return obj;
    }
  }

  /**
   * Creates an OSP control and establishes communication between the control and the model.
   *
   * <p>Custom buttons are usually added to this control to invoke actions in the model.
   *
   * @param model Object
   * @return AnimationControl
   */
  public static OSPControl createApp(Object model) {
    OSPControl control = new OSPControl(model);
    control.setSize(300, 300);
    control.setVisible(true);
    return control;
  }
}
示例#10
0
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    m_jPanelTitle = new javax.swing.JPanel();
    m_jLblTitle = new javax.swing.JLabel();
    poweredby = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    m_jPanelContainer = new javax.swing.JPanel();
    m_jPanelLogin = new javax.swing.JPanel();
    jPanel4 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jPanel5 = new javax.swing.JPanel();
    m_jLogonName = new javax.swing.JPanel();
    jScrollPane1 = new javax.swing.JScrollPane();
    jPanel2 = new javax.swing.JPanel();
    jPanel8 = new javax.swing.JPanel();
    m_jClose = new javax.swing.JButton();
    jPanel1 = new javax.swing.JPanel();
    m_txtKeys = new javax.swing.JTextField();
    m_jPanelDown = new javax.swing.JPanel();
    panelTask = new javax.swing.JPanel();
    m_jHost = new javax.swing.JLabel();
    jPanel3 = new javax.swing.JPanel();

    setPreferredSize(new java.awt.Dimension(1024, 768));
    setLayout(new java.awt.BorderLayout());

    m_jPanelTitle.setBorder(
        javax.swing.BorderFactory.createMatteBorder(
            0, 0, 1, 0, javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")));
    m_jPanelTitle.setLayout(new java.awt.BorderLayout());

    m_jLblTitle.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    m_jLblTitle.setText("Window.Title");
    m_jPanelTitle.add(m_jLblTitle, java.awt.BorderLayout.CENTER);

    poweredby.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/com/openbravo/images/poweredby.png"))); // NOI18N
    poweredby.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 5, 0, 5));
    m_jPanelTitle.add(poweredby, java.awt.BorderLayout.LINE_END);

    jLabel2.setPreferredSize(new java.awt.Dimension(142, 34));
    m_jPanelTitle.add(jLabel2, java.awt.BorderLayout.LINE_START);

    add(m_jPanelTitle, java.awt.BorderLayout.NORTH);

    m_jPanelContainer.setLayout(new java.awt.CardLayout());

    m_jPanelLogin.setLayout(new java.awt.BorderLayout());

    jPanel4.setLayout(new javax.swing.BoxLayout(jPanel4, javax.swing.BoxLayout.Y_AXIS));

    jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    jLabel1.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/com/openbravo/images/logo.png"))); // NOI18N
    jLabel1.setText(
        "<html><center>SysNeo POS es un software de punto de venta intuitivo, de f&aacute;cil uso e ideal para las PyMes Peruanas.<br>"
            + "Copyright \u00A9 2012-2014 SysNeo POS, <br>"
            + "http://www.sysneoconsulting.com/ptoventa<br>"
            + "<br>"
            + "SysNeo POS est&aacute; basado en Openbravo POS, sistema de codigo abierto que mantiene los derechos bajo los t&eacute;minos de la GNU General Public License mantenido por la Free Software Foundation.<br>"
            + "<br>"
            + "SysNeo POS es ejecutado bajo autorización de uso y/o licencia de SysNeo Consulting.<br>"
            + "<br>"
            + "SysNeo Consulting, empresa responsable de SysNeo POS. http://www.sysneoconsulting.com<br>"
            + "</center>");
    jLabel1.setAlignmentX(0.5F);
    jLabel1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jLabel1.setMaximumSize(new java.awt.Dimension(800, 1024));
    jLabel1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jPanel4.add(jLabel1);

    m_jPanelLogin.add(jPanel4, java.awt.BorderLayout.CENTER);

    m_jLogonName.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
    m_jLogonName.setLayout(new java.awt.BorderLayout());

    jScrollPane1.setHorizontalScrollBarPolicy(
        javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
    jScrollPane1.setVerticalScrollBarPolicy(
        javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
    jScrollPane1.setPreferredSize(new java.awt.Dimension(510, 118));
    m_jLogonName.add(jScrollPane1, java.awt.BorderLayout.CENTER);

    jPanel2.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 5, 0, 5));
    jPanel2.setLayout(new java.awt.BorderLayout());

    jPanel8.setLayout(new java.awt.GridLayout(0, 1, 5, 5));

    m_jClose.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/com/openbravo/images/exit.png"))); // NOI18N
    m_jClose.setText(AppLocal.getIntString("Button.Close")); // NOI18N
    m_jClose.setFocusPainted(false);
    m_jClose.setFocusable(false);
    m_jClose.setPreferredSize(new java.awt.Dimension(115, 35));
    m_jClose.setRequestFocusEnabled(false);
    m_jClose.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            m_jCloseActionPerformed(evt);
          }
        });
    jPanel8.add(m_jClose);

    jPanel2.add(jPanel8, java.awt.BorderLayout.NORTH);

    jPanel1.setLayout(null);

    m_txtKeys.setPreferredSize(new java.awt.Dimension(0, 0));
    m_txtKeys.addKeyListener(
        new java.awt.event.KeyAdapter() {
          public void keyTyped(java.awt.event.KeyEvent evt) {
            m_txtKeysKeyTyped(evt);
          }
        });
    jPanel1.add(m_txtKeys);
    m_txtKeys.setBounds(0, 0, 0, 0);

    jPanel2.add(jPanel1, java.awt.BorderLayout.CENTER);

    m_jLogonName.add(jPanel2, java.awt.BorderLayout.LINE_END);

    jPanel5.add(m_jLogonName);

    m_jPanelLogin.add(jPanel5, java.awt.BorderLayout.SOUTH);

    m_jPanelContainer.add(m_jPanelLogin, "login");

    add(m_jPanelContainer, java.awt.BorderLayout.CENTER);

    m_jPanelDown.setBorder(
        javax.swing.BorderFactory.createMatteBorder(
            1, 0, 0, 0, javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")));
    m_jPanelDown.setLayout(new java.awt.BorderLayout());

    m_jHost.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/com/openbravo/images/display.png"))); // NOI18N
    m_jHost.setText("*Hostname");
    panelTask.add(m_jHost);

    m_jPanelDown.add(panelTask, java.awt.BorderLayout.LINE_START);
    m_jPanelDown.add(jPanel3, java.awt.BorderLayout.LINE_END);

    add(m_jPanelDown, java.awt.BorderLayout.SOUTH);
  } // </editor-fold>//GEN-END:initComponents
 public LabelRenderer() {
   setHorizontalAlignment(SwingConstants.RIGHT);
   setOpaque(true); // make background visible.
   setForeground(Color.black);
   setBackground(javax.swing.UIManager.getColor("Panel.background")); // $NON-NLS-1$
 }
示例#12
0
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    m_jOptions = new javax.swing.JPanel();
    m_jButtons = new javax.swing.JPanel();
    m_jTicketId = new javax.swing.JLabel();
    m_jEdit = new javax.swing.JButton();
    m_jRefund = new javax.swing.JButton();
    m_jPrint = new javax.swing.JButton();
    jPanel2 = new javax.swing.JPanel();
    m_jPanelTicket = new javax.swing.JPanel();
    jPanel3 = new javax.swing.JPanel();
    jPanel4 = new javax.swing.JPanel();
    m_jKeys = new com.openbravo.editor.JEditorKeys();
    jPanel5 = new javax.swing.JPanel();
    jButton1 = new javax.swing.JButton();
    m_jTicketEditor = new com.openbravo.editor.JEditorIntegerPositive();

    setLayout(new java.awt.BorderLayout());

    m_jOptions.setLayout(new java.awt.BorderLayout());

    m_jButtons.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));

    m_jTicketId.setBackground(java.awt.Color.white);
    m_jTicketId.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    m_jTicketId.setBorder(
        javax.swing.BorderFactory.createCompoundBorder(
            javax.swing.BorderFactory.createLineBorder(
                javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")),
            javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4)));
    m_jTicketId.setOpaque(true);
    m_jTicketId.setPreferredSize(new java.awt.Dimension(160, 25));
    m_jTicketId.setRequestFocusEnabled(false);
    m_jButtons.add(m_jTicketId);

    m_jEdit.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/com/openbravo/images/edit.png"))); // NOI18N
    m_jEdit.setText(AppLocal.getIntString("button.edit")); // NOI18N
    m_jEdit.setFocusPainted(false);
    m_jEdit.setFocusable(false);
    m_jEdit.setMargin(new java.awt.Insets(8, 14, 8, 14));
    m_jEdit.setRequestFocusEnabled(false);
    m_jEdit.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            m_jEditActionPerformed(evt);
          }
        });
    m_jButtons.add(m_jEdit);

    m_jRefund.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/com/openbravo/images/inbox.png"))); // NOI18N
    m_jRefund.setText(AppLocal.getIntString("button.refund")); // NOI18N
    m_jRefund.setFocusPainted(false);
    m_jRefund.setFocusable(false);
    m_jRefund.setMargin(new java.awt.Insets(8, 14, 8, 14));
    m_jRefund.setRequestFocusEnabled(false);
    m_jRefund.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            m_jRefundActionPerformed(evt);
          }
        });
    m_jButtons.add(m_jRefund);

    m_jPrint.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/com/openbravo/images/yast_printer.png"))); // NOI18N
    m_jPrint.setText(AppLocal.getIntString("button.print")); // NOI18N
    m_jPrint.setFocusPainted(false);
    m_jPrint.setFocusable(false);
    m_jPrint.setMargin(new java.awt.Insets(8, 14, 8, 14));
    m_jPrint.setRequestFocusEnabled(false);
    m_jPrint.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            m_jPrintActionPerformed(evt);
          }
        });
    m_jButtons.add(m_jPrint);

    m_jOptions.add(m_jButtons, java.awt.BorderLayout.WEST);

    jPanel2.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));
    m_jOptions.add(jPanel2, java.awt.BorderLayout.CENTER);

    add(m_jOptions, java.awt.BorderLayout.NORTH);

    m_jPanelTicket.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
    m_jPanelTicket.setLayout(new java.awt.BorderLayout());
    add(m_jPanelTicket, java.awt.BorderLayout.CENTER);

    jPanel3.setLayout(new java.awt.BorderLayout());

    jPanel4.setLayout(new javax.swing.BoxLayout(jPanel4, javax.swing.BoxLayout.Y_AXIS));

    m_jKeys.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            m_jKeysActionPerformed(evt);
          }
        });
    jPanel4.add(m_jKeys);

    jPanel5.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
    jPanel5.setLayout(new java.awt.GridBagLayout());

    jButton1.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/com/openbravo/images/button_ok.png"))); // NOI18N
    jButton1.setFocusPainted(false);
    jButton1.setFocusable(false);
    jButton1.setMargin(new java.awt.Insets(8, 14, 8, 14));
    jButton1.setRequestFocusEnabled(false);
    jButton1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
    jPanel5.add(jButton1, gridBagConstraints);
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    jPanel5.add(m_jTicketEditor, gridBagConstraints);

    jPanel4.add(jPanel5);

    jPanel3.add(jPanel4, java.awt.BorderLayout.NORTH);

    add(jPanel3, java.awt.BorderLayout.EAST);
  } // </editor-fold>//GEN-END:initComponents
示例#13
0
 /** @param args the command line arguments */
 public static void main(String args[]) {
   /* Set the Nimbus look and feel */
   // <editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
   /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
    * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
    */
   try {
     for (javax.swing.UIManager.LookAndFeelInfo info :
         javax.swing.UIManager.getInstalledLookAndFeels()) {
       if ("Nimbus".equals(info.getName())) {
         javax.swing.UIManager.setLookAndFeel(info.getClassName());
         break;
       }
     }
   } catch (ClassNotFoundException ex) {
     java.util.logging.Logger.getLogger(FrameLogin.class.getName())
         .log(java.util.logging.Level.SEVERE, null, ex);
   } catch (InstantiationException ex) {
     java.util.logging.Logger.getLogger(FrameLogin.class.getName())
         .log(java.util.logging.Level.SEVERE, null, ex);
   } catch (IllegalAccessException ex) {
     java.util.logging.Logger.getLogger(FrameLogin.class.getName())
         .log(java.util.logging.Level.SEVERE, null, ex);
   } catch (javax.swing.UnsupportedLookAndFeelException ex) {
     java.util.logging.Logger.getLogger(FrameLogin.class.getName())
         .log(java.util.logging.Level.SEVERE, null, ex);
   }
   // </editor-fold>
   /*try {
       String host = "jdbc:mysql://localhost:3306/2761DB";
       String uname = "root";
       String upassword = "******";
       Connection con = DriverManager.getConnection(host, uname, upassword );
       String SQL = "SELECT * FROM Persons";
       Statement stmt = con.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);
       ResultSet rs = stmt.executeQuery( SQL );
       while(rs.next()){
           String firstName = rs.getString("FirstName");
           String lastName = rs.getString("LastName");
           int personId = rs.getInt("PersonId");
           String firstName = rs.getString("FirstName");
           String lastName = rs.getString("LastName");
           int cellPhone = rs.getInt("CellPhoneNo");
           int homePhone = rs.getInt("HomePhoneNo");
           int schoolId = rs.getInt("SchoolId");
           int grade = rs.getInt("Grad"
                   + "e");
           System.out.println(personId + " " + firstName + " " + lastName + " " + cellPhone + " " + homePhone + " " + schoolId + " " + grade);
       }
   } catch (SQLException err) {
       System.out.println( err.getMessage( ) );
   }*/
   /* Create and display the form */
   java.awt.EventQueue.invokeLater(
       new Runnable() {
         public void run() {
           JFrame FrameLogin = new FrameLogin();
           // FrameLogin.setExtendedState(JFrame.MAXIMIZED_BOTH);
           FrameLogin.setVisible(true);
         }
       });
 }
示例#14
0
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    buttonGroup1 = new javax.swing.ButtonGroup();
    m_jOptions = new javax.swing.JPanel();
    m_jButtons = new javax.swing.JPanel();
    m_jTicketId = new javax.swing.JLabel();
    jButton2 = new javax.swing.JButton();
    m_jEdit = new javax.swing.JButton();
    m_jRefund = new javax.swing.JButton();
    m_jPrint = new javax.swing.JButton();
    jPanel2 = new javax.swing.JPanel();
    m_jPanelTicket = new javax.swing.JPanel();
    jPanel3 = new javax.swing.JPanel();
    jPanel4 = new javax.swing.JPanel();
    m_jKeys = new com.openbravo.editor.JEditorKeys();
    jPanel5 = new javax.swing.JPanel();
    jButton1 = new javax.swing.JButton();
    m_jTicketEditor = new com.openbravo.editor.JEditorIntegerPositive();
    jPanel1 = new javax.swing.JPanel();
    jrbSales = new javax.swing.JRadioButton();
    jrbRefunds = new javax.swing.JRadioButton();

    setLayout(new java.awt.BorderLayout());

    m_jButtons.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));

    m_jTicketId.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
    m_jTicketId.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
    m_jTicketId.setBorder(
        javax.swing.BorderFactory.createCompoundBorder(
            javax.swing.BorderFactory.createLineBorder(
                javax.swing.UIManager.getDefaults().getColor("Button.darkShadow")),
            javax.swing.BorderFactory.createEmptyBorder(1, 4, 1, 4)));
    m_jTicketId.setOpaque(true);
    m_jTicketId.setPreferredSize(new java.awt.Dimension(160, 25));
    m_jTicketId.setRequestFocusEnabled(false);
    m_jButtons.add(m_jTicketId);

    jButton2.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
    jButton2.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/com/openbravo/images/search24.png"))); // NOI18N
    jButton2.setText(AppLocal.getIntString("button.print")); // NOI18N
    jButton2.setToolTipText("Search Tickets");
    jButton2.setFocusPainted(false);
    jButton2.setFocusable(false);
    jButton2.setMargin(new java.awt.Insets(0, 4, 0, 4));
    jButton2.setMaximumSize(new java.awt.Dimension(50, 40));
    jButton2.setMinimumSize(new java.awt.Dimension(50, 40));
    jButton2.setPreferredSize(new java.awt.Dimension(50, 40));
    jButton2.setRequestFocusEnabled(false);
    jButton2.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton2ActionPerformed(evt);
          }
        });
    m_jButtons.add(jButton2);

    m_jEdit.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
    m_jEdit.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/com/openbravo/images/sale_editline.png"))); // NOI18N
    m_jEdit.setText(AppLocal.getIntString("button.print")); // NOI18N
    m_jEdit.setToolTipText("Edit current Ticket");
    m_jEdit.setFocusPainted(false);
    m_jEdit.setFocusable(false);
    m_jEdit.setMargin(new java.awt.Insets(0, 4, 0, 4));
    m_jEdit.setMaximumSize(new java.awt.Dimension(50, 40));
    m_jEdit.setMinimumSize(new java.awt.Dimension(50, 40));
    m_jEdit.setPreferredSize(new java.awt.Dimension(50, 40));
    m_jEdit.setRequestFocusEnabled(false);
    m_jEdit.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            m_jEditActionPerformed(evt);
          }
        });
    m_jButtons.add(m_jEdit);

    m_jRefund.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
    m_jRefund.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/com/openbravo/images/inbox.png"))); // NOI18N
    m_jRefund.setText(AppLocal.getIntString("button.print")); // NOI18N
    m_jRefund.setToolTipText("Receipt Refund");
    m_jRefund.setFocusPainted(false);
    m_jRefund.setFocusable(false);
    m_jRefund.setMargin(new java.awt.Insets(0, 4, 0, 4));
    m_jRefund.setMaximumSize(new java.awt.Dimension(50, 40));
    m_jRefund.setMinimumSize(new java.awt.Dimension(50, 40));
    m_jRefund.setPreferredSize(new java.awt.Dimension(50, 40));
    m_jRefund.setRequestFocusEnabled(false);
    m_jRefund.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            m_jRefundActionPerformed(evt);
          }
        });
    m_jButtons.add(m_jRefund);

    m_jPrint.setFont(new java.awt.Font("Arial", 0, 11)); // NOI18N
    m_jPrint.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/com/openbravo/images/printer24.png"))); // NOI18N
    m_jPrint.setText(AppLocal.getIntString("button.print")); // NOI18N
    m_jPrint.setToolTipText("Reprint Receipt");
    m_jPrint.setFocusPainted(false);
    m_jPrint.setFocusable(false);
    m_jPrint.setMargin(new java.awt.Insets(0, 4, 0, 4));
    m_jPrint.setMaximumSize(new java.awt.Dimension(50, 40));
    m_jPrint.setMinimumSize(new java.awt.Dimension(50, 40));
    m_jPrint.setPreferredSize(new java.awt.Dimension(50, 40));
    m_jPrint.setRequestFocusEnabled(false);
    m_jPrint.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            m_jPrintActionPerformed(evt);
          }
        });
    m_jButtons.add(m_jPrint);

    m_jOptions.add(m_jButtons);

    jPanel2.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT));
    m_jOptions.add(jPanel2);

    add(m_jOptions, java.awt.BorderLayout.NORTH);

    m_jPanelTicket.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
    m_jPanelTicket.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
    m_jPanelTicket.setLayout(new java.awt.BorderLayout());
    add(m_jPanelTicket, java.awt.BorderLayout.CENTER);

    jPanel3.setLayout(new java.awt.BorderLayout());

    jPanel4.setLayout(new javax.swing.BoxLayout(jPanel4, javax.swing.BoxLayout.Y_AXIS));

    m_jKeys.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            m_jKeysActionPerformed(evt);
          }
        });
    jPanel4.add(m_jKeys);

    jPanel5.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
    jPanel5.setLayout(new java.awt.GridBagLayout());

    jButton1.setIcon(
        new javax.swing.ImageIcon(
            getClass().getResource("/com/openbravo/images/ok.png"))); // NOI18N
    jButton1.setToolTipText("Enter Receipt and touch to Find by Number");
    jButton1.setFocusPainted(false);
    jButton1.setFocusable(false);
    jButton1.setMargin(new java.awt.Insets(8, 14, 8, 14));
    jButton1.setRequestFocusEnabled(false);
    jButton1.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
          }
        });
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 1;
    gridBagConstraints.gridy = 0;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    gridBagConstraints.insets = new java.awt.Insets(0, 5, 0, 0);
    jPanel5.add(jButton1, gridBagConstraints);

    m_jTicketEditor.setFont(new java.awt.Font("Arial", 0, 12)); // NOI18N
    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 0;
    jPanel5.add(m_jTicketEditor, gridBagConstraints);

    jPanel4.add(jPanel5);

    jPanel3.add(jPanel4, java.awt.BorderLayout.NORTH);

    buttonGroup1.add(jrbSales);
    jrbSales.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
    jrbSales.setText(AppLocal.getIntString("label.sales")); // NOI18N
    jrbSales.setToolTipText("Show Sales Only");
    jrbSales.setFocusPainted(false);
    jrbSales.setFocusable(false);
    jrbSales.setRequestFocusEnabled(false);
    jPanel1.add(jrbSales);

    buttonGroup1.add(jrbRefunds);
    jrbRefunds.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
    jrbRefunds.setForeground(new java.awt.Color(255, 0, 0));
    jrbRefunds.setText(AppLocal.getIntString("label.refunds")); // NOI18N
    jrbRefunds.setToolTipText("Show Refunds Only");
    jrbRefunds.setFocusPainted(false);
    jrbRefunds.setFocusable(false);
    jrbRefunds.setRequestFocusEnabled(false);
    jPanel1.add(jrbRefunds);

    jPanel3.add(jPanel1, java.awt.BorderLayout.CENTER);

    add(jPanel3, java.awt.BorderLayout.EAST);
  } // </editor-fold>//GEN-END:initComponents