Adding 1 JComponent to 2 different JPanels: good idea?

Is there any general rule which says it is a bad idea to add 1 JComponent to 2 different JPanels?
It would make my life a lot easier if it's no problem. In that case I only have to update one.

Good point about models. With text components you can share the Document. With other components you can share the model. Here is a simple example:
import java.awt.*;
import javax.swing.*;
public class MirrorTextField extends JFrame
     public MirrorTextField()
          JTextField textField1 = new JTextField( 20 );
          getContentPane().add( textField1, BorderLayout.NORTH );
          JTextField textField2 = new JTextField( 20 );
          textField2.setDocument( textField1.getDocument() );
          getContentPane().add( textField2, BorderLayout.SOUTH );
          String[] items = { "one", "two", "three", "four", };
          DefaultComboBoxModel model = new DefaultComboBoxModel( items );
          JComboBox comboBox1 = new JComboBox( model );
          getContentPane().add( comboBox1, BorderLayout.WEST );
          JComboBox comboBox2 = new JComboBox( model );
          getContentPane().add( comboBox2, BorderLayout.EAST );
     public static void main(String[] args)
          MirrorTextField frame = new MirrorTextField();
          frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
          frame.pack();
          frame.setVisible(true);
}Other components like JButton, JCheckBox, JRadioButton extend AbstractButton which has getModel(), setModel() methods you should be able to use.

Similar Messages

  • Adding same object(jtextfield) to different cards in card layout

    Have a combo box with 3 items which changes cards in a cardLayout.
    Have 3 panels as card in a cardLayout.
    Want to reuse the field txtName, lblName in pnlName and reuse txtAge, lblAge in pnlAge in all the cards.
    It only appears in the last card3 panel(i.e the last panel referenced)
    Is there a way I can show the same object(pnlName, pnlAge) in all the cards,
    Below is the code, any solution is welcome.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class CardLayoutTest implements ItemListener {
    JPanel cards; //a panel that uses CardLayout
    public void addComponentToPane(Container pane) {
    //Put the JComboBox in a JPanel to get a nicer look.
    JPanel comboBoxPane = new JPanel(); //use FlowLayout
    String comboBoxItems[] = { "Name", "ShortDetail","FullDetail"};
    JComboBox cb = new JComboBox(comboBoxItems);
    cb.setEditable(false);
    cb.addItemListener(this);
    comboBoxPane.add(cb);
              JLabel lblName, lblAddress, lblAge;
              JCheckBox chkMarried;
              JRadioButton rdbMale, rdbFemale;
              JTextField txtName, txtAddress, txtAge, txtSex;
              JPanel pnlName = new JPanel(new FlowLayout(FlowLayout.LEFT));
              pnlName.add(lblName = new JLabel("Name"));
              pnlName.add(txtName = new JTextField(10));
              JPanel pnlAddress = new JPanel(new FlowLayout(FlowLayout.LEFT));
              pnlAddress.add(lblAddress = new JLabel("Address"));
              pnlAddress.add(txtAddress = new JTextField(10));
              JPanel pnlAge = new JPanel(new FlowLayout(FlowLayout.LEFT));
              pnlAge.add(lblAge = new JLabel("Age"));
              pnlAge.add(txtAge = new JTextField(3));
              JPanel pnlSex = new JPanel(new FlowLayout(FlowLayout.LEFT));
              pnlSex.add(rdbMale = new JRadioButton("Male"));
              pnlSex.add(rdbFemale = new JRadioButton("Female"));
              JPanel pnlMarried = new JPanel(new FlowLayout(FlowLayout.LEFT));
              pnlMarried.add(chkMarried = new JCheckBox("Married"));
              //pnl3.add(lblName = new JTextField(10));
              JPanel card1 = new JPanel(new GridLayout(0,1));
              card1.add(new JLabel("Card1"));
              card1.add(pnlName);
              card1.add(pnlAge);
              JPanel card2 = new JPanel(new GridLayout(0,1));
              card2.add(new JLabel("Card2"));
              card2.add(pnlName);
              card2.add(pnlAge);
              card2.add(pnlAddress);
              JPanel card3 = new JPanel(new GridLayout(0,1));
              card3.add(new JLabel("Card3"));
              card3.add(pnlName);
              card3.add(pnlAge);
              card3.add(pnlSex);
              card3.add(pnlMarried);
    //Create the "cards".
    JPanel card1 = new JPanel();
    card1.add(new JButton("Button 1"));
    card1.add(new JButton("Button 2"));
    card1.add(new JButton("Button 3"));
    JPanel card2 = new JPanel();
    card2.add(new JTextField("TextField", 20));
         JPanel card3 = new JPanel();
    card3.add(new JLabel("Label"));
         JPanel card4 = new JPanel();
    card4.add(new JCheckBox("Hello Holla"));
    JPanel card5 = new JPanel();
              cards.add();
    //Create the panel that contains the "cards".
    cards = new JPanel(new CardLayout());
    cards.add(card1, "Name");
    cards.add(card2, "ShortDetail");
    cards.add(card3, "FullDetail");
    pane.add(comboBoxPane, BorderLayout.PAGE_START);
    pane.add(cards, BorderLayout.CENTER);
    public void itemStateChanged(ItemEvent evt) {
    CardLayout cl = (CardLayout)(cards.getLayout());
    cl.show(cards, (String)evt.getItem());
    private static void createAndShowGUI() {
    JFrame frame = new JFrame("CardLayoutTest");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    CardLayoutTest demo = new CardLayoutTest();
    demo.addComponentToPane(frame.getContentPane());
         frame.pack();
    frame.setVisible(true);
    public static void main(String[] args) {
    //Schedule a job for the event-dispatching thread:
    //creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    createAndShowGUI();
    }

    I'm 99% sure that you cannot have the same txtfields/combos in different JPanels at the same time, which explains why they only appear in the last panel they are added to... but I guess you already knew that.
    You could add these components to the panel you wish to show each time you change panels.
    Or
    you could have a panel which contains these components and add it to each of the 3 panels that you show on your cardLayout.
    Or
    you could store the values selected in the components in globals to your class and replicate each of the components with this data in each of your three panels.

  • How to pass/share components between different JPanels/Container

    Dear Friends,
    I know here a lot Java Guru, I met a problem below.
    How can I pass components between different JPanels??
    here, ListPanelMain.java is main,
    When I click a tree node in splitPane, I can see all its children on the right splitpane, but I hope they can be seen on another Panel called "ListRightPane.java"
    How to do it??
    Why cannot pass??
    [1]. main Program:
    package swing.com.test.test;
    import javax.swing.JFrame;
    import java.awt.BorderLayout;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JSplitPane;
    import javax.swing.JTextArea;
    import java.io.Serializable;
    import swing.com.test.test.ListPanel;
    import java.awt.GridLayout;
    public class ListPanelMain implements java.io.Serializable{
         private JFrame frame;
         * Launch the application
         * @param args
         public static void main(String args[]) {
              try {
                   ListPanelMain window = new ListPanelMain();
                   window.frame.setVisible(true);
              } catch (Exception e) {
                   e.printStackTrace();
         * Create the application
         public ListPanelMain() {
              initialize();
         * Initialize the contents of the frame
         private void initialize() {
              frame = new JFrame("FileTreePanelMain");
              frame.setBounds(100, 100, 900, 675);
         //     FieTreePanelComm      ftreecomm                = new      FieTreePanelComm();
              ListPanel                ftree                     = new      ListPanel("C:\\");
    //          ListAllFile           ftree                     = new      ListAllFile("C:\\");
         //     FileTreePanelText      fileTreePanelText      = new      FileTreePanelText(ftreecomm);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              final JPanel panel = new JPanel();
              panel.setLayout(new GridLayout(0, 2));
              frame.getContentPane().add(panel, BorderLayout.CENTER);
         //     final JSplitPane splitPane = new JSplitPane();
         //     frame.getContentPane().add(splitPane, BorderLayout.CENTER);
         //     splitPane.setLeftComponent(ftree);
              panel.add(ftree);
              final ListRightPanel listRightPanel = new ListRightPanel(ftree);
              //splitPane.setRightComponent(listRightPanel);
              panel.add(listRightPanel);
         frame.addWindowListener(new WindowAdapter() {
         public void windowClosing(WindowEvent e) {
         System.exit(0);
         frame.pack();
         frame.setVisible(true);
    [2]. Program 2:
    package swing.com.test.test;
    //File System Tree
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.GridLayout;
    import java.io.File;
    import java.util.Iterator;
    import java.util.Vector;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JSplitPane;
    import javax.swing.JTextArea;
    import javax.swing.JTree;
    import javax.swing.JPanel;
    import javax.swing.event.TreeModelEvent;
    import javax.swing.event.TreeModelListener;
    import javax.swing.event.TreeSelectionEvent;
    import javax.swing.event.TreeSelectionListener;
    import javax.swing.tree.TreeModel;
    import javax.swing.tree.TreePath;
    import java.io.Serializable;
    public class ListPanel extends JPanel implements Serializable{
    protected JTree fileTree;
    private FileSystemModel fileSystemModel;
    private JTextArea ltextArea = new JTextArea();
    protected JTextArea fileDetailsTextArea = new JTextArea();
    private String str = "";
         public String getlTextArea() {
                   //textArea.getText();
                   return str;
         public String setlTextArea(String ta) {
                   ltextArea.setText(ta);
                   str = ta;
                   return str;
    public ListPanel(String directory) {
    //super("JTree FileSystem Viewer");
                   setLayout(new BorderLayout());
                   final JPanel panel = new JPanel();
                   panel.setLayout(new BorderLayout());
              add(panel, BorderLayout.CENTER);
    fileDetailsTextArea.setEditable(false);
    fileSystemModel = new FileSystemModel(new File(directory));
    fileTree = new JTree(fileSystemModel);
    fileTree.setEditable(true);
    fileTree.addTreeSelectionListener(new TreeSelectionListener() {
    public void valueChanged(TreeSelectionEvent event) {
    System.out.println("1. What we save is: getlTextArea() =" + getlTextArea() );
    File file = (File) fileTree.getLastSelectedPathComponent();
    fileDetailsTextArea.setText(getFileDetails(file));
    final ListRightPanel lrp = new ListRightPanel(this);
    lrp.textArea.setText(getFileDetails(file));
    setlTextArea(getFileDetails(file));
    System.out.println("2. What we save is: getlTextArea() =" + getlTextArea() );
              final JSplitPane splitPane = new JSplitPane();
              panel.add(splitPane, BorderLayout.CENTER);
              final JPanel panel_1 = new JPanel();
              splitPane.setLeftComponent(panel_1);
              panel_1.add(new JScrollPane(fileTree));
              final JPanel panel_2 = new JPanel();
              splitPane.setRightComponent(panel_2);
              panel_2.add(new JScrollPane(fileDetailsTextArea));
    setVisible(true);
    private String getFileDetails(File file) {
    if (file == null)
    return "";
    StringBuffer buffer = new StringBuffer();
    if (file.listFiles()!=null){
         for (int i=0; i< file.listFiles().length; i++){
         buffer.append(((file.listFiles())) + "\n");
         System.out.println("List all files");
    return buffer.toString();
    public static void main(String args[]) {
    new ListPanel("c:\\");
    class FileSystemModel implements TreeModel {
    private File root;
    private Vector listeners = new Vector();
    public FileSystemModel(File rootDirectory) {
    root = rootDirectory;
    public Object getRoot() {
    return root;
    public Object getChild(Object parent, int index) {
    File directory = (File) parent;
    String[] children = directory.list();
    return new TreeFile(directory, children[index]);
    public int getChildCount(Object parent) {
    File file = (File) parent;
    if (file.isDirectory()) {
    String[] fileList = file.list();
    if (fileList != null)
    return file.list().length;
    return 0;
    public boolean isLeaf(Object node) {
    File file = (File) node;
    return file.isFile();
    public int getIndexOfChild(Object parent, Object child) {
    File directory = (File) parent;
    File file = (File) child;
    String[] children = directory.list();
    for (int i = 0; i < children.length; i++) {
    if (file.getName().equals(children[i])) {
    return i;
    return -1;
    public void valueForPathChanged(TreePath path, Object value) {
    File oldFile = (File) path.getLastPathComponent();
    String fileParentPath = oldFile.getParent();
    String newFileName = (String) value;
    File targetFile = new File(fileParentPath, newFileName);
    oldFile.renameTo(targetFile);
    File parent = new File(fileParentPath);
    int[] changedChildrenIndices = { getIndexOfChild(parent, targetFile) };
    Object[] changedChildren = { targetFile };
    fireTreeNodesChanged(path.getParentPath(), changedChildrenIndices, changedChildren);
    private void fireTreeNodesChanged(TreePath parentPath, int[] indices, Object[] children) {
    TreeModelEvent event = new TreeModelEvent(this, parentPath, indices, children);
    Iterator iterator = listeners.iterator();
    TreeModelListener listener = null;
    while (iterator.hasNext()) {
    listener = (TreeModelListener) iterator.next();
    listener.treeNodesChanged(event);
    public void addTreeModelListener(TreeModelListener listener) {
    listeners.add(listener);
    public void removeTreeModelListener(TreeModelListener listener) {
    listeners.remove(listener);
    private class TreeFile extends File {
    public TreeFile(File parent, String child) {
    super(parent, child);
    public String toString() {
    return getName();
    [3]. Program 3:
    package swing.com.test.test;
    import java.awt.BorderLayout;
    import java.io.File;
    import javax.swing.JPanel;
    import javax.swing.JTextArea;
    import javax.swing.JTree;
    import javax.swing.event.TreeModelEvent;
    import javax.swing.event.TreeModelListener;
    import javax.swing.event.TreeSelectionEvent;
    import javax.swing.event.TreeSelectionListener;
    import javax.swing.tree.TreeModel;
    import javax.swing.tree.TreePath;
    import java.io.Serializable;
    public class ListRightPanel extends JPanel implements TreeSelectionListener, Serializable{
         protected JTextArea textArea;
    //     protected ListAllFile laf;
    private String str = "";
              public String getlTextArea() {
                        //textArea.getText();
                        return str;
              public String setlTextArea(String ta) {
                        str = ta;
                        return str;
         * Create the panel
         public ListRightPanel(ListPanel laff) {
              super();
              setLayout(new BorderLayout());
              final JPanel panel = new JPanel();
              panel.setLayout(new BorderLayout());
              add(panel, BorderLayout.CENTER);
              textArea = new JTextArea();
    final String st = laff.getlTextArea();
    System.out.println("####################################");
    System.out.println("st=" + st);
         laff.fileTree.addTreeSelectionListener(new TreeSelectionListener() {
         public void valueChanged(TreeSelectionEvent event) {
         //laff.textArea.setText(getFileDetails(file));
              textArea.setText(getlTextArea());
         System.out.println("ListRightPanel Was Invoked from ListPanel!!getlTextArea() =" + getlTextArea() );
         System.out.println("st=" + st);
              panel.add(textArea, BorderLayout.CENTER);
         public void valueChanged(TreeSelectionEvent e){};
    It is runnable program, just compile and run it in Console is ok,
    Regards
    Sunny

    Thnaks, code post again, see
    [1]. package swing.com.test.test;
    import javax.swing.JFrame;
    import java.awt.BorderLayout;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JSplitPane;
    import javax.swing.JTextArea;
    import java.io.Serializable;
    import swing.com.test.test.ListPanel;
    import java.awt.GridLayout;
    public class ListPanelMain implements java.io.Serializable{
         private JFrame frame;
          * Launch the application
          * @param args
         public static void main(String args[]) {
              try {
                   ListPanelMain window = new ListPanelMain();
                   window.frame.setVisible(true);
              } catch (Exception e) {
                   e.printStackTrace();
          * Create the application
         public ListPanelMain() {
              initialize();
          * Initialize the contents of the frame
         private void initialize() {
              frame = new JFrame("FileTreePanelMain");
              frame.setBounds(100, 100, 900, 675);
         //     FieTreePanelComm      ftreecomm                = new       FieTreePanelComm();
              ListPanel                 ftree                     = new      ListPanel("C:\\");
    //          ListAllFile            ftree                     = new      ListAllFile("C:\\");
         //     FileTreePanelText      fileTreePanelText      = new      FileTreePanelText(ftreecomm);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              final JPanel panel = new JPanel();
              panel.setLayout(new GridLayout(0, 2));
              frame.getContentPane().add(panel, BorderLayout.CENTER);
         //     final JSplitPane splitPane = new JSplitPane();
         //     frame.getContentPane().add(splitPane, BorderLayout.CENTER);
         //     splitPane.setLeftComponent(ftree);
              panel.add(ftree);
              final ListRightPanel listRightPanel = new ListRightPanel(ftree);
              //splitPane.setRightComponent(listRightPanel);
              panel.add(listRightPanel);
                frame.addWindowListener(new WindowAdapter() {
                     public void windowClosing(WindowEvent e) {
                         System.exit(0);
                 frame.pack();
                 frame.setVisible(true);
    }[2] Program 2
    package swing.com.test.test;
    //File System Tree
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.GridLayout;
    import java.io.File;
    import java.util.Iterator;
    import java.util.Vector;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JSplitPane;
    import javax.swing.JTextArea;
    import javax.swing.JTree;
    import javax.swing.JPanel;
    import javax.swing.event.TreeModelEvent;
    import javax.swing.event.TreeModelListener;
    import javax.swing.event.TreeSelectionEvent;
    import javax.swing.event.TreeSelectionListener;
    import javax.swing.tree.TreeModel;
    import javax.swing.tree.TreePath;
    import java.io.Serializable;
    public class ListPanel extends JPanel implements Serializable{
      protected JTree fileTree;
      private FileSystemModel fileSystemModel;
      private JTextArea ltextArea = new JTextArea();
      protected JTextArea fileDetailsTextArea = new JTextArea();
      private String str = "";
         public  String getlTextArea()  {
                   //textArea.getText();
                      return str;
         public  String setlTextArea(String ta)  {
                   ltextArea.setText(ta);
                   str = ta;
                      return str;
      public ListPanel(String directory) {
        //super("JTree FileSystem Viewer");
                   setLayout(new BorderLayout());
                   final JPanel panel = new JPanel();
                   panel.setLayout(new BorderLayout());
                  add(panel, BorderLayout.CENTER);
        fileDetailsTextArea.setEditable(false);
        fileSystemModel = new FileSystemModel(new File(directory));
        fileTree = new JTree(fileSystemModel);
        fileTree.setEditable(true);
        fileTree.addTreeSelectionListener(new TreeSelectionListener() {
          public void valueChanged(TreeSelectionEvent event) {
            System.out.println("1. What we save is: getlTextArea() =" + getlTextArea() );
            File file = (File) fileTree.getLastSelectedPathComponent();
            fileDetailsTextArea.setText(getFileDetails(file));
            final ListRightPanel lrp = new ListRightPanel(this);
            lrp.textArea.setText(getFileDetails(file));
            setlTextArea(getFileDetails(file));
            System.out.println("2. What we save is: getlTextArea() =" + getlTextArea() );
              final JSplitPane splitPane = new JSplitPane();
              panel.add(splitPane, BorderLayout.CENTER);
              final JPanel panel_1 = new JPanel();
              splitPane.setLeftComponent(panel_1);
              panel_1.add(new JScrollPane(fileTree));
              final JPanel panel_2 = new JPanel();
              splitPane.setRightComponent(panel_2);
              panel_2.add(new JScrollPane(fileDetailsTextArea));
        setVisible(true);
      private String getFileDetails(File file) {
        if (file == null)
          return "";
        StringBuffer buffer = new StringBuffer();
        if (file.listFiles()!=null){
             for (int i=0; i< file.listFiles().length; i++){
             buffer.append(((file.listFiles())) + "\n");
         System.out.println("List all files");
    return buffer.toString();
    public static void main(String args[]) {
    new ListPanel("c:\\");
    class FileSystemModel implements TreeModel {
    private File root;
    private Vector listeners = new Vector();
    public FileSystemModel(File rootDirectory) {
    root = rootDirectory;
    public Object getRoot() {
    return root;
    public Object getChild(Object parent, int index) {
    File directory = (File) parent;
    String[] children = directory.list();
    return new TreeFile(directory, children[index]);
    public int getChildCount(Object parent) {
    File file = (File) parent;
    if (file.isDirectory()) {
    String[] fileList = file.list();
    if (fileList != null)
    return file.list().length;
    return 0;
    public boolean isLeaf(Object node) {
    File file = (File) node;
    return file.isFile();
    public int getIndexOfChild(Object parent, Object child) {
    File directory = (File) parent;
    File file = (File) child;
    String[] children = directory.list();
    for (int i = 0; i < children.length; i++) {
    if (file.getName().equals(children[i])) {
    return i;
    return -1;
    public void valueForPathChanged(TreePath path, Object value) {
    File oldFile = (File) path.getLastPathComponent();
    String fileParentPath = oldFile.getParent();
    String newFileName = (String) value;
    File targetFile = new File(fileParentPath, newFileName);
    oldFile.renameTo(targetFile);
    File parent = new File(fileParentPath);
    int[] changedChildrenIndices = { getIndexOfChild(parent, targetFile) };
    Object[] changedChildren = { targetFile };
    fireTreeNodesChanged(path.getParentPath(), changedChildrenIndices, changedChildren);
    private void fireTreeNodesChanged(TreePath parentPath, int[] indices, Object[] children) {
    TreeModelEvent event = new TreeModelEvent(this, parentPath, indices, children);
    Iterator iterator = listeners.iterator();
    TreeModelListener listener = null;
    while (iterator.hasNext()) {
    listener = (TreeModelListener) iterator.next();
    listener.treeNodesChanged(event);
    public void addTreeModelListener(TreeModelListener listener) {
    listeners.add(listener);
    public void removeTreeModelListener(TreeModelListener listener) {
    listeners.remove(listener);
    private class TreeFile extends File {
    public TreeFile(File parent, String child) {
    super(parent, child);
    public String toString() {
    return getName();
    [3] Program 3:
    package swing.com.test.test;
    import java.awt.BorderLayout;
    import java.io.File;
    import javax.swing.JPanel;
    import javax.swing.JTextArea;
    import javax.swing.JTree;
    import javax.swing.event.TreeModelEvent;
    import javax.swing.event.TreeModelListener;
    import javax.swing.event.TreeSelectionEvent;
    import javax.swing.event.TreeSelectionListener;
    import javax.swing.tree.TreeModel;
    import javax.swing.tree.TreePath;
    import java.io.Serializable;
    public class ListRightPanel extends JPanel implements TreeSelectionListener, Serializable{
         protected JTextArea textArea;
    //     protected ListAllFile  laf;
        private String str = "";
              public  String getlTextArea()  {
                        //textArea.getText();
                           return str;
              public  String setlTextArea(String ta)  {
                        str = ta;
                           return str;
          * Create the panel
         public ListRightPanel(ListPanel  laff) {
              super();
              setLayout(new BorderLayout());
              final JPanel panel = new JPanel();
              panel.setLayout(new BorderLayout());
              add(panel, BorderLayout.CENTER);
              textArea = new JTextArea();
            final String st = laff.getlTextArea();
            System.out.println("####################################");
            System.out.println("st=" + st);
             laff.fileTree.addTreeSelectionListener(new TreeSelectionListener() {
                 public void valueChanged(TreeSelectionEvent event) {
                   //laff.textArea.setText(getFileDetails(file));
                      textArea.setText(getlTextArea());
                     System.out.println("ListRightPanel Was Invoked from ListPanel!!getlTextArea() =" + getlTextArea() );
                     System.out.println("st=" + st);
              panel.add(textArea, BorderLayout.CENTER);
           public void valueChanged(TreeSelectionEvent e){};
    }You can try this one, thanks again
    sunny

  • Different Finished Goods in the Same Job

    Hi,
    We would like to know if it is possible to complete different finished goods using a single job (based on a single bill). This is the scenario: we have to cut a raw material RM1 that has 1.5 inches and the result is two finished goods, FG1 with 0.5 inch and FG2 with 1.0 inch.
    Thanks in advance,
    Renato.

    Hi,
    This can be addressed by OPM, where in the Formula you will be able to enter two co-products FG1 and FG2 in the Products Tab of Formulator Module and Ingredient as RM.
    When you produce a Batch(equivalent to Job in Discrete Mfg), FG1 and FG2 will come out in required proportions as you mention in the Formula.
    In Discrete there is no standard Prodedure for it. I might Suggest a work around. See whether it can suit you:
    You create BOM of FG1 and enter Componnts as RM and FG2. Enter the Required Qty of FG2 in Negative. In this case FG2 will be treated as a Byproduct.
    Regards....Saugata

  • Why does it take so long for microsoft to incorporate good ideas into programs, but then after they do no one elses software will work on the system?

    Case in point: I can not use Xp any longer since it is not supported by microsoft, and latest lan driver requires xp service packs which are no longer available for XP or Vista. So my old software as of April 2014 is now worthless as internet access software(microsoft
    will not provide support or service packs for xp). So I get a new pc with WIN7 op system installed and try to do traditional backups to protect myself should my system crash in the future. (usually this means cloning a hard drive or installing Faronics Deep
    Freeze to protect my op system in case of catastrophic failure.) I try to install and use some of these utility software types including Acronis Disk Director 12, Avanquest Perfect Image, Partition Commander 10, and others True Image Hdd utility for cloning
    hdds. Most of these I try to run turn out to be useless, and I get pop-up messages saying my software is incompatible with win 7 op sys! I am wondering if it is the software or the fact the op system is 64bit (not 32 bit) which means that if you buy any other
    software to help with utilities it will be worthless because most are written for 32 bit systems not 64. No one tells you these warning signs when you buy the pc with the 64 bit software already installed. But for a Toshiba 15" computer that normally
    costs 400$ and I can get it at Goodwill used computer store(1stStreet and Fairview in Santa Ana, Ca.) for 175$ I can not complain. Being an unemployed electronic technician, I have to stretch my dollars as far as they will go...Another frustrating thing is
    I buy this device made by Apricorn Driveware that allows users to hookup a second hdd using a usb cable and a three connector module that will allow the user to connect any hard drive sata or ide or the 3rd type. I try to run it and make a backup copy of internal
    hdd but I get error messages saying it can not copy hdds when there are minor differences such as total mbs on each drive or slightly different hardware issues such as my pc has 580 gb internal drive and replacement backup drive is 380gb. Such as shame because
    hardware setup is a good idea but without compatible software it is useless! Perhaps if I was using it on my old xp op systems I would have fewer problems with software compatibility issues. I really hate the fact that MS does not provide support for known
    good op systems like xp say 20yrs? When the products and markets change so fast they run the risk of alienating customers who can not financially keep up with technology changes especially during an economic depression such as the one we are in now( they predict
    it will last 20 yrs). a curious thing about the Acronis disk director 12 software I installed. It seemed I could not get partion size on hdd to change no matter what I did. I found out that if I CHANGED THE DATA BLOCK SIZE ON THE NTFS PARTITION FROM 4 KB TO
    2 KB THAT I WAS NO LONGER LIMITED BY THE SOFTWARE FROM SHRINKING THE HDD PARTITION FROM 300GB DOWN TO 100GB. Once this item was changed on the hard drives the Disk Director 12 software (Acronis) was able to shrink the partition size to what I wanted.

    Due to phenomenal development in Windows, Microsoft released 4 generations of operating systems, succeeding Windows XP. Hence, on various aspects, Windows XP becomes too old to be used practically these days. So the support was pulled out.
    I do agree that Windows XP is the most successful operating system ever, so far. But, later versions added more features, enhanced security and compatibility. Moreover, at this point, Windows XP becomes more vulnerable, although security patches are made.
    Ultimately, we need to move to a more secure, feature-rich and highly compatible operating system.
    With improved features in newer versions of Windows, the NTFS filesystem has also been improved, adding new features. Hence, certain feaures that are not availble in Windows XP are available in Windows 7, again, in Windows 8.1. So is the disk management
    features.
    As for Acronis Disk Director, it's a third party software and hence we can't comment on the features/its working.
    Balaji Kundalam

  • Is using a taskbar icon in .exe combined with windows service a good idea as part of an alarm system?

    My client wants an alert system and his focus is on the taskbar.  He wants the icon to change, (and ideally even blink) and also to have some beeping when a new work request comes in.  It needs to run constantly, and grab the attention of an operator
    who may not be paying much attention to the screen.
    I’m excited to develop this, but after years of web development, I feel paralyzed.  I must be making this harder than it needs to be, but here’s my plan…  I'll start with a windows form, which will run minimized, and have an icon that looks like
    a hammer in the taskbar.  A timer would continually check for a new service requests.  When it sees one it would change the toolbar icon to a red x and sent a few dozen beeps out to the operator.  I think I need a windows service running that
    checks periodically to see if my windows exe is running.  If not, it should start it up.  Perhaps this could be a scheduled task, rather than a service.  
    Some of my questions are;
    How do I change the taskbar icon on the fly?
    Is this a good idea, or is there an easier way?
    Snippets of code or related articles are most welcome!
    Thanks!

    So I created a windows form and added a timer to check for unacknowledged requests.  If it finds any, it changes the icon on for the taskbar, and makes a beep.  Simple, but it works.  However, I'm having a beep of a time trying to figure out
    where to put the ico files so they are where they need when I publish it.  Others seem to suggest adding them using the properties of the application, under application / resources / Icon and manigest blah blah blah.  But I can only seem to add one
    there.  I need the three different ones.  I'm confused!  Any suggestions?
            private bool iconBig = true;
            private Icon redcross = new Icon("..\\NewRequest.ico");
            private Icon redcross2 = new Icon("..\\NewRequest2.ico");
            private Icon hammer = new Icon("..\\Hammer.ico");
     private void timer1_Tick(object sender, EventArgs e)
                List<WorkRequest> myWorkRequests = WorkRequestData.WorkRequest_unAcknowledged();
                if (myWorkRequests.Count > 0)
                    for (int i = 0; i < 5; i++)
                        SystemSounds.Beep.Play();
                        if (iconBig == true)
                            iconBig = false;
                            this.Icon = redcross;
                            this.Refresh();
                        else
                            iconBig = true;
                            this.Icon = redcross2;
                            this.Refresh();
                else
                    this.Icon = hammer;
                    this.Refresh();

  • Is buying in the US a good idea?

    Hello,
    I currently live in the Netherlands, a small country next to Germany. In about 2 years I will go to college and will need a laptop. As I'm going to an industrial designers Academy I am going to need a laptop with quite some graphic capabilities. Apple intermediately invaded my mind with their super laptops, the mac book pro in particular. Now my question is if it's a good idea to buy the mac book pro 15" in the US? From what I've heard I won't have any repair warranty for in the Netherlands. But is this a big issue? I don't know if the mac book pro brings a lot of issues with it because it will be my first apple computer. I only have experience with apple through my ipod touch 1st gen. Whenever I had problems with that I just went to the internet and found an answer there to my problem.
    It is a big difference if I buy it in the Netherlands or in the US because the price differs from the dutch price 2100 euro's (3108 dollars) for the mac book pro 2.8 GHz and in the US 2300 dollars (1554.05 euro's).
    That differs 808 dollars or 545.95 euro's.
    So does the mac book pro have some problems and are these easily fixable by yourself with a little internet help?
    So what will it be?
    buying in the Netherlands with a higher price but a active warranty. so with lower risk of a unsolvable problem?
    or buying in the US with a much lower price but a chance on unsolvable problems?
    please help me and give arguments.
    thank you.
    Message was edited by: Davinovic

    Hi and welcome to both these forums and when you arrive to the United States. Your question concerning the warranty should be addressed to Apple Support just to make sure, but I would agree that wherever you purchase your Macintosh the warranty should be world wide. Considering the price difference I'd recommend the US. I suspect the difference in price has more to do with EuroUnion VATs than anything else. We don't have VATs here in the states, though you'll have to pay any local sales taxes (I know, the difference escapes me). Though once you're here buying online often avoids even that tax. In the US taxation is largely voluntary (ok ok, think about it). That means if you order online from a company in California and have the item delivered in, say, Indiana the California company will inform you that you have to pay Indiana sales tax on the item, but will not collect it at the time of sale. The burden of paying the tax is upon you, voluntarily submitting the tax to the Indiana Dept of Revenue. While some states are really trying to tighten this up it is still very common practice to simply not pay the local sales tax as no one is tracking this information. This sort of thing relates to the unique relationship between the Federal government and those of the individual, nearly sovereign, states.
    Now as for the MBP I contend you cannot buy a more solid, reliable, fast laptop, period. Firstly, Apple is the number one computer company in consumer satisfaction. AppleCare is worth it. I've had several experiences personally and with friends and family with Apple's warranty fulfillment and it is totally awesome. The MBP itself is state of the art, sleek, and the best industrial design out there (OK Sony comes close, but no one else does). The OS is virus free and very easy to use. You can run Mac OS X, Linux, Unix, and Windows of any flavor, so if you absolutely have to use some vertical market Windows based program it's easy as pie to launch bootcamp or other VM OS and you're in windows.
    I got my first Mac back in '86 and haven't even considered another OS (I did have a PowerComputing clone for a while and frankly even then Apple was better built). The average PC lasts about 2.5 yrs. The average Macintosh about 4.5 years, more than enough to get you through college.
    Keep hitting these forums as you'll find a wealth of information and thousands of helpful hands.
    Again, Welcome!

  • I want to use a fantom diamond as an external hard drive for my mac, is this a good idea?

    Using a Macbook pro, with Snow Leopard (I think), and my memory is full so I want to store my stuff on an external hard drive. I found a 2T Fantom Diamond EHD, but I'm now learning that I have to convert to NTFS-3g. I'm not computer savy so I want to know if this is a good idea, or should I look for something different. Also, can I set up the EHD as the default path for itunes?

    This is not the forum for MacBook Pro owners.
    You just need to reformat the drive in Disk Utility and erase the drive and have  Mac HFS.
    If you did need to use NTFS then you would not want -3G but Paragon NTFS for OS X x. 10.0
    Or buy something that isn't pre-formatted to Windows NT file system.
    First though make sure you have backups of your system. TimeMachine being used now?
    http://macperformanceguide.com/Mac-TimeMachine-drive.html
    http://www.apple.com/support/timemachine/
    Maybe cleanout some files you don't need.
    Install a larger notebook hard drive even.
    http://www.macsales.com/firewire has a lot of choice in Mac compatible drives and enclosures so you don't need to worry about Fantom not working at some point.
    https://discussions.apple.com/community/notebooks/macbook_pro
    https://discussions.apple.com/community/mac_os/mac_os_x_v10.6_snow_leopard

  • Use of "Rel" Attribute in Links -- Good Idea?

    Hi --
    I was reading about various SEO methods recently and came
    across several
    pages which advocate the use of the "Rel" attribute on a
    hyperlink. The idea
    being that the "Rel" may influence how a search engine views
    a link and
    possibly help with ranking. For example: <a
    href="help.html" rel="Help">
    need help?</a>.
    Sounds like a good idea, but the more I read the confused I
    became. A Danny
    Sullivan article about use of the attribute "nofollow" used
    by major search
    engines made sense. It was the other article I read which
    used all
    different types of attributes that confused me such as
    rel="met colleague",
    rel="alternate". Is there someplace I can go to find a list
    of widely
    accepted attributes?
    Anyone have any experience with this?
    John

    Thanks, Joe. Yep, the source is the best place to start.
    Should have
    thought of that myself.
    I suspect you're assessment is correct...won't hurt, might
    help.
    Thanks again.
    John
    "Joe Makowiec" <[email protected]> wrote in
    message
    news:[email protected]..
    > On 02 Apr 2008 in macromedia.dreamweaver, Tarvardian
    wrote:
    >
    >> Is there someplace I can go to find a list of widely
    >> accepted attributes?
    >
    > How 'bout the source?
    >
    >
    http://www.w3.org/TR/html401/struct/links.html#adef-rel
    >
    > Note that it has a set of defined values:
    >
    >
    http://www.w3.org/TR/html401/types.html#type-links
    >
    > In looking over the documentation, and given my
    understanding of the way
    > things work in the here and now, I suspect that it's one
    of those "Won't
    > hurt, might help" kind of things.
    >
    > --
    > Joe Makowiec
    >
    http://makowiec.net/
    > Email:
    http://makowiec.net/contact.php

  • Is it a good idea to update my iphone 3GS with the new io6 software?  I did it with my iphone 3G and the io4 software ruined it really!

    Is it a good idea to update my iphone 3GS with the new io6 software?  I did it with my iphone 3G and the io4 software ruined it really!

    Your plan is generally OK, but I would suggest a different approach, since you're so frazzled by it.
    1. Update iPhoto first; check and backup the iPhoto Library;
    2. Upgrade to Yosemite; This will prompt you to migrate to Photos, but you don't have to do it, so don't!
    3. iPhoto 9.6.1 will remain in your Applications folder and you can continue to use it;
    4. Learn more about Photos, it's features and how iCloud Photo Library really works (for example, once you turn it on, you won't need to download manually);
    5. When you do feel you know enough about Photos, only then launch it to migrate your photos; after migration your iPhoto Library remains fully functional, in case you want to revert to using iPhoto, so that part should not worry you.
    Thet biggest issue you have is the small amount of free space. You might want to address tha first, or locate your new Photos Library on an external drive as well, and only move it to your local drive when it's been optimized (or keep it on an external).

  • Apex and remote database links.... Good idea or bad?

    We would like to have one single Apex installation that would be used to develop many applications against many remote databases.
    Database links would seem to be the obvious mechanism to achieve this goal, but we have had many issues with db links.
    Also, our research indicates this might not be a good idea for various reasons.
    Any opinions or experiences around this topic would be greatly appreciated.

    we have had many issues with db links. In that case it's a bad idea.
    It's not really an Apex question. If you can't get db links to work, it's a database issue. If it's performance over the db link, again it's a database issue (assuming modern networks aren't the bottleneck here). Remote views (instead of selecting from remote tables) often increase performance.
    If the applications don't have to share data over the db links, you can set up one master application and several sub-applications on the different databases. The master is used to log in once. See:
    http://www.oracle.com/technetwork/issue-archive/2009/09-may/o39security-101079.html

  • I have a mac and am thinking about upgrading from snowlepard to lion , is it a good idea and hard to adapt to

    i have a mac and am thinking about upgrading from snowlepard to lion , is it a good idea and hard to adapt to

    This is my "About This Mac" ... it shows I have Intel i7 CPU.  If you are running SL, you at least have Intel, but would need at least Core2Duo an 2 GB (most people suggest 4 GB) RAM.
    If you want to run Lion, remember that the discussions in this forum from last summer when Lion first came out (and since) were highly charged at times.  Certain features that vanished or were added caused great heartache for some.  Others love Lion, though.  And some live with the changes waiting for any fixes they would desire.
    Any PPC (PowerPC) applications you depend upon will not work under Lion.  Use this page to see what applications will not run:  http://roaringapps.com/apps:table
    AND
    Recall that you can clone your SL to an external disk to keep it safe.  Then you can "experiment with" the new OSX (Lion or ML) until you know it works for you while still having your old SL safe in case you need it.
    Good luck.

  • Is that a good idea to put many things in /etc/rc.local?

    Hello, all:
    wiki told me that I could configure many files in /etc.
    However, sorry if sounds stupid, I think this is not KISS.
    I have to learn many different syntax to configure my computer.
    I think put things in /etc/rc.local if possible is a good idea.
    For example, We could configure things in this way:
    [/etc/rc.conf] DAEMONS=(crond)
    [/etc/fstab]   /dev/sda3 /home ext4 rw,relatime 0 1
    [/etc/modules-load.d/vb.conf] vboxdrv
    For a alternate, we could edit /etc/rc.local like this:
    rc.d start crond
    mount /dev/sda3 /home
    modprobe vboxdrv
    Now we do not need to learn any new syntax, everything is BASH!

    ytj wrote:
    For example, We could configure things in this way:
    For a alternate, we could edit /etc/rc.local like this:
    I think there SHOULD be a problem with this but... I don't see a problem with this. It works in your situation, but of course it wouldn't for everyone. For example, I assume if something on /home was needed during boot then you would need to load it earlier in /etc/fstab.
    I'll probably end up doing it the first way just to be more "correct". I do already have some stuff in /etc/rc.local, such as setting up soft links to my disc drives.
    brebs wrote:The future is systemd (so it seems), not BASH.
    Bash isn't going away any time soon. Are you suggesting that /etc/rc.local will be going away?

  • Deploying Server Based Software-Good Idea?

    Hi,
    We need to deploy a variety of components to 200+ different sites around the country-about 120MB total. The software includes:
    1. A JDK
    2. An application server
    3. A web services server
    4. JDBC drivers
    5. Our wars/jars
    6. Configuration files, etc.
    We have always distributed by burning a CD and shipping it to each location. We have also considered sending out detailed instructions for downloading each component from the appropriate web site but this process is, as expected, prone to user error. Just finding the correct version of the JDK is too confusing for most of our customers. Things need to be simple.
    How about deployment via Web Start? Is it an appropriate use to load server software at a remote location?
    David

    Hi David,
    I've actually done some research in this area in terms of building a new product. IMHO, the answer is yes, this is a good idea, but no, tools designed to update client-side GUI applications (like Web Start or my company's DeployDirector) are not really appropriate in this case.
    The problem is not so much the initial install as it is the subsequent updates.
    The difficulty with updating a server application is that it's always running -- client-side applications are usually started and stopped, which creates a convenient time to update. For server-side applications, you'd need to have some way to ensure that you don't update while in the middle of a transaction, some way of handling users that are connected to the app, some way of queuing transactions until the update is complete, etc.
    Updating (and even the initially installing) remotely may be difficult due to security as well. Some companies may block you from getting anywere near the servers from a remote locations.
    There's also business issues; some places may be wary of having an external company change things on their systems. Some places have set times when they release new systems into production. There's also the issue of handling what happens if the update fails for some reason -- how do you track, diagnose and fix that remotely?
    Because this is your own product and your own customers, you may not encounter all these problems. But updating server software is a much messier issue than updating client software.
    OTOH, if the main thing you are worried about is the installing and configuring the software initially (i.e., no auto-updating) then you're probably best off with an installer package like InstallAnywhere. I think they have a way of letting your break up the download into smaller components and then handling all the configuration for you.
    Sonal
    Product Manager - DeployDirector
    [email protected]

  • Thinking of converting a secondary DC & replica DFS into a Hyper-V host - a good idea?

    Hello!
    I am trying to minimize the amount of server hardware regarding adding more servers to our domain (2008 R2).
    We have a quite new and strong (2x 6-core xeon with 24GB RAM) secondary DC server in our 2008 R2 domain. I am trying to come up with a better plan to utilize this machine's resources which was a bit of an overkill for just an AD, DNS and DFS services.
    Do you think it would be a good idea to demote that server, erase it, install 2008 R2 in Hyper-V mode and then add the AD service with DNS and DFS in Virtual mode and more (separate) virtual servers for other various purposes - thinking of Remote Desktop
    Services specifically for now, it can't run on same physical server as AD which is a slight problem as we are not planning on getting any hardware anytime soon.
    Can MS Exchange also run on Hyper-V? That would be a plus as well if it could.
    Thanks for insights.
    I am new to Hyper-V, never tried it before. Also forgot to mention, we use 2008 R2 Standard licenses, not enterprise/datacenter whatever.

    http://www.microsoft.com/en-us/download/details.aspx?id=3512
    is this the "regular free Hyper-V" you mentioned? is it a standalone OS that needs no key?
    anyways, the question stands, I am not sure I can use the physical and virtual keys (from 2 standard licenses) in VMs, i'd certainly like to... 4 VMs sound really good, much better than 2.
    that is the old one, there is a new 2012 R2 version for datacenters
    http://technet.microsoft.com/en-US/evalcenter/dn205299.aspx
    Corsair Carbide 300R with window
    Corsair TX850V2 70A@12V
    Asus M5A99FX PRO R2.0 CFX/SLI
    AMD Phenom II 965 C3 Black Edition @ 4.0 GHz
    G.SKILL RipjawsX DDR3-2133 8 GB
    EVGA GTX 6600 Ti FTW Signature 2(Gk104 Kepler)
    Asus PA238QR IPS LED HDMI DP 1080p
    ST2000DM001 & Windows 8.1 Enterprise x64
    Microsoft Wireless Desktop 2000
    Wacom Bamboo CHT470M
    Place your rig specifics into your signature like I have, makes it 100x easier to understand!
    Hardcore Games Legendary is the Only Way to Play!
    that's an evaluation software ... 180 days license or something? or worse, a beta version?
    I'm talking about production environment in live business ...
    reviewed the 2008 R2 licensing and it seems that no matter the approach, each of Standard licenses allows only for a single VM...
    EDIT:
    OK, that is a full feature version, free and supposedly an RTM, which is good. might consider it for future.
    either way, legally speaking, the licensing problem with 2008 R2 STD still exists, because officially you can use only 1 STD license per VM. As far as I understand from legal standpoint, one cannot use both physical + virtual keys (from a single 2008
    R2 license) for two separate VM guests, no matter how, it probably is not OK (even though it may work and activate properly).

Maybe you are looking for

  • Back-up or Proprietary Storage

    I have a MacBook Pro from around 2010 (not sure of year of manufacture but purchased new in 2010).  I have a Western Digital external HD that is 500GB in size.  I have been using it as a back-up for the last two years or so, 6 times a day, scheduled

  • Doesn't this basic FK constaint lead to catch22 scenario?

    Version:11g What would you do if you wanted to UPDATE a column in the parent table like the one below? Its a bit of CATCH-22 situation. I can't update the parent table without updating the child table and i can't update the child table without updati

  • [ALSB 3.0] ImportError: No module named wli

    Hi all, I've already posted a problem that I got moving my WLST scripts from ALSB 2.6 to 3.0. As suggested in threadID=300006156 I changed some deprecated code. The error is: [java] Problem invoking WLST - Traceback (innermost last): [java] File "...

  • How to convert video files on itunes help

    how do you convert a movie file using itunes? i have a movie file randomly as .mkv thanks!

  • Trace a particular MAC address

    Hi I run an apple network and I have a device somewhere on my network with the same IP address as my router! I know the MAC address (00:1e:52:7e:c2:31) of the rogue device, which I know is an Apple product - how can I find out what it is? Please help