Laying out buttons in a panel

I have a panel with 4 buttons. The panel is added to the main window using BorderLayout.SOUTH so that the buttons are at the bottom of the window. Now I want to align the buttons on the right side of the panel, like so:
| |
| ----- ----- ----- ----- |
| | b1| | b2| | b3| | b4| |
| ----- ----- ----- ----- |
| |
The obvious thing to do here is use
myPanel.setAlignmentX(Component.RIGHT_ALIGNMENT);
But it doesn't work. Any suggestions are greatly appreciated.
Jason

Any idea why the
panel.setAlignmentX(Component.RIGHT_ALIGNMENT)
wouldn't do the trick?Because the panel is using a BorderLayout. Any inherent behavior specified by the panel would be overshadowed by the behavior specified by the BorderLayout layout manager.
By the way you also asked a component alignment question here: http://forum.java.sun.com/thread.jsp?forum=57&thread=352465
If any of the replies answered your question then you should award the duke dollar.

Similar Messages

  • How can I copy a button to a panel?

    I am working on this project where I have 3 buttons that need to be dragged to a panel. I have created a new TransferHanndler that can support dropping to a panel. Now I have to figure out to actually copy an image of that button to the panel wherever the mouse position is, and be able to move it around in that panel and change its position.
    Here is what I have so far:
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import javax.swing.JButton;
    import javax.swing.JComponent;
    import javax.swing.TransferHandler;
    * DNDApplet.java
    * Created on June 10, 2008, 4:11 PM
    * @author  Evie
    public class DNDApplet extends javax.swing.JApplet {
        /** Initializes the applet DNDApplet */
        public void init() {
            try {
                java.awt.EventQueue.invokeAndWait(new Runnable() {
                    public void run() {
                        initComponents();
                        initHandlers();
            } catch (Exception ex) {
                ex.printStackTrace();
        public void initHandlers(){
            MouseListener listener = new DragMouseAdapter();
            jButton1.addMouseListener(listener);
            jButton2.addMouseListener(listener);
            jButton3.addMouseListener(listener);
            JButton buttonClone = new JButton();
            jButton1.setTransferHandler(new ButtonTransferable("hello"));
            jButton2.setTransferHandler(new ButtonTransferable("hello2"));
            jButton3.setTransferHandler(new ButtonTransferable("hello3"));
            jPanel1.addMouseListener(listener);
            jPanel1.setTransferHandler(new ButtonTransferable("goodbye"));
            //jEditorPane1.setDragEnabled(true);
            //jEditorPane1.setTransferHandler(new TransferHandler("text"));
            //jButton2.setTransferHandler(new TransferHandler("text"));
            //label2.setTransferHandler(new TransferHandler("icon"));
        /** This method is called from within the init() method to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
            jButton1 = new javax.swing.JButton();
            jButton2 = new javax.swing.JButton();
            jButton3 = new javax.swing.JButton();
            jPanel1 = new javax.swing.JPanel();
            jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cube.gif"))); // NOI18N
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/sphere.gif"))); // NOI18N
            jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/triangle.gif"))); // NOI18N
            jPanel1.setBackground(new java.awt.Color(204, 204, 255));
            javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
            jPanel1.setLayout(jPanel1Layout);
            jPanel1Layout.setHorizontalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 279, Short.MAX_VALUE)
            jPanel1Layout.setVerticalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGap(0, 199, Short.MAX_VALUE)
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                        .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                            .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18)
                            .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGap(18, 18, 18)
                            .addComponent(jButton3)))
                    .addContainerGap(111, Short.MAX_VALUE))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton3)
                        .addComponent(jButton2)
                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(18, 18, 18)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addContainerGap())
        }// </editor-fold>
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    // TODO add your handling code here:
        // Variables declaration - do not modify
        private javax.swing.JButton jButton1;
        private javax.swing.JButton jButton2;
        private javax.swing.JButton jButton3;
        private javax.swing.JPanel jPanel1;
        // End of variables declaration
    class DragMouseAdapter extends MouseAdapter {
            public void mousePressed(MouseEvent e) {
                JComponent c = (JComponent) e.getSource();
                TransferHandler handler = c.getTransferHandler();
                handler.exportAsDrag(c, e, TransferHandler.COPY);
    And this is my transfer handler
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    * @author Evie
    import java.awt.Component;
    import java.awt.Dimension;
    import java.awt.datatransfer.DataFlavor;
    import java.awt.datatransfer.StringSelection;
    import java.awt.datatransfer.Transferable;
    import javax.swing.DefaultButtonModel;
    import javax.swing.DefaultListModel;
    import javax.swing.GroupLayout;
    import javax.swing.JComponent;
    import javax.swing.JList;
    import javax.swing.JButton;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.TransferHandler;
    public class ButtonTransferable extends TransferHandler {
        private int[] indices = null;
        private int addIndex = -1; //Location where items were added
        private int addCount = 0;  //Number of items added.
        private String item;
        private String name;
        private JButtonX comp;
        //private BufferedImage thumb;
        private String thumb;
        public ButtonTransferable (String s) {
            //this.comp = (JButtonX)c;
            JButtonX newButton = new JButtonX();
            this.comp = newButton;
        ButtonTransferable(String s, String s0) {
            throw new UnsupportedOperationException("Not yet implemented");
         * We only support importing strings.
        public boolean canImport(TransferHandler.TransferSupport info) {
            // Check for String flavor
            if (!info.isDataFlavorSupported(DataFlavor.stringFlavor)) {
                return false;
            return true;
         * Bundle up the selected items in a single list for export.
         * Each line is separated by a newline.
        protected Transferable createTransferable(JComponent c) {
            //JList list = (JList)c;
            JButton button = (JButton) c;
            //indices = list.getSelectedIndices();
            name = button.getName();
            //Object[] values = list.getSelectedValues();
            StringBuffer buff = new StringBuffer();
            /*for (int i = 0; i < values.length; i++) {
                Object val = values;*/
    buff.append("The button was transferred");
    /*if (i != values.length - 1) {
    buff.append("\n");
    return new StringSelection(buff.toString());
    * We support both copy and move actions.
    public int getSourceActions(JComponent c) {
    return TransferHandler.COPY_OR_MOVE;
    * Perform the actual import. This demo only supports drag and drop.
    public boolean importData(TransferHandler.TransferSupport info) {
    if (!info.isDrop()) {
    return false;
    System.out.println("I imported a string");
    JPanel panel = (JPanel)info.getComponent();
    //DefaultModel listModel = (DefaultListModel)list.getModel();
    //JList.DropLocation dl = (JList.DropLocation)info.getDropLocation();
    //int index = dl.getIndex();
    //boolean insert = dl.isInsert();
    // Get the string that is being dropped.
    Transferable t = info.getTransferable();
    String data;
    try {
    data = (String)t.getTransferData(DataFlavor.stringFlavor);
    catch (Exception e) { return false; }
    /***Declaring new JButton variables**/
    JButton jb = new javax.swing.JButton();
    jb.setIcon(new javax.swing.ImageIcon(getClass().getResource("/cube.gif"))); // NOI18N
    /*//clone
    JButtonX cloneLab = null;
    cloneLab = (JButtonX)comp.clone();
    cloneLab.setName("clonebtn");
    cloneLab.setToolTipText("clonebtn");
    cloneLab.setVisible(true);
    panel.add(cloneLab);
    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(panel);
    panel.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(jPanel1Layout.createSequentialGroup()
    .addContainerGap()
    .addComponent(jb)
    .addContainerGap(panel.getMousePosition().y, Short.MAX_VALUE))
    jPanel1Layout.setVerticalGroup(
    jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
    .addGroup(jPanel1Layout.createSequentialGroup()
    .addContainerGap()
    .addComponent(jb)
    .addContainerGap(panel.getMousePosition().x, Short.MAX_VALUE))
    Component compArray[] = panel.getComponents();
    int size = compArray.length;
    for(int i = 0; i < size; i++)
    System.out.println("element "+i+" is: " +compArray[i].getName());
    return true;
    * Remove the items moved from the list.
    protected void exportDone(JComponent c, Transferable data, int action) {
    JButton source = (JButton)c;
    DefaultButtonModel listModel = (DefaultButtonModel)source.getModel();
    /*if (action == TransferHandler.MOVE) {
    for (int i = indices.length - 1; i >= 0; i--) {
    //listModel.remove(indices[i]);
    indices = null;
    addCount = 0;
    addIndex = -1;
    }Edited by: hannoona on Jun 13, 2008 8:50 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Ok the problem was the layout in buttonTransferable.java
    Here is what was changed and it worked.
    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(panel);
            panel.setLayout(jPanel1Layout);
            jPanel1Layout.setHorizontalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup()
                    .addContainerGap()
    //HERE IS WHAT WAS ADDED
                    .addGap(panel.getMousePosition().x, panel.getMousePosition().x, panel.getMousePosition().x)
                    .addComponent(jb)
                    .addContainerGap(panel.getMousePosition().y, Short.MAX_VALUE))
            jPanel1Layout.setVerticalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel1Layout.createSequentialGroup()
                    .addContainerGap()
    //HERE IS WAT WAS ADDED AS WELL
                   .addGap(panel.getMousePosition().y, panel.getMousePosition().y, panel.getMousePosition().y)
                    .addComponent(jb)
                    .addContainerGap(panel.getMousePosition().x, Short.MAX_VALUE))
            jb.setLocation(panel.getMousePosition().x, panel.getMousePosition().y);
            jb.setToolTipText("hi. im new.");
            System.out.println("mouse x is: "+panel.getMousePosition().x);
            System.out.println("mouse y is: "+panel.getMousePosition().y);
            System.out.println("jb x is: "+jb.getX());
            System.out.println("jb y is: "+jb.getY());
            return true;

  • Help! How can I lay out forms?

    Hi:
    I've tried everything and I just can't get Java to lay out a form for me.
    I'm currently using TableLayout:
    http://www.clearthought.info/software/TableLayout/
    I expect the buttons to be in the bottom right hand corner of the form.
    Only one shows up and it's apparantly over top the other one. They're at the top of the form.
    What am I doing wrong?
    public static void main(String[] args)
            btnOne = new JButton(" One ");
            btnOne.setPreferredSize(new Dimension(80, 25));
            btnTwo = new JButton(" Two ");
            btnTwo.setPreferredSize(new Dimension(80, 25));
            lbOne = new JLabel("Top Label");
            lbTwo=  new JLabel("Second Label");
           double size[][] =
                {{TableLayout.FILL, 200},
                 {0.05, TableLayout.FILL, 25}};
            pnExt = new JPanel(new TableLayout(size));
            pnExt.setPreferredSize(new Dimension(775, 575));
            double sizeLbl[][] =
                {{250},
                 {0.05, TableLayout.FILL, 25}};
            pnLabel = new JPanel(new TableLayout(sizeLbl));
            pnLabel.add(lbOne, "0, 0, l, t");
            pnLabel.add(lbTwo, "0, 0, l, t");
             double sizeBtn[][] =
                {{150},
                 {TableLayout.FILL, 25, 25}};
            pnButtons = new JPanel(new TableLayout(sizeBtn));
            pnButtons.setPreferredSize(new Dimension(125, 550));
            pnButtons.add(btnOne, "0, 1, r, b");
            pnButtons.add(btnTwo, "0, 2, r, b");
            pnExt.add(lbOne, "0, 0, l, t");
            pnExt.add(pnLabel, "0, 1, l, t");
            pnExt.add(pnButtons, "1, 0");
            fme = new JFrame("My Test");
            fme.setSize(800, 600);
            fme.getContentPane().add(pnExt, BorderLayout.WEST);    
            fme.show();
        }

    I've never used TableLayout, but here is some code for a common situation. Suppose you want components arranged like this:
    label component (say text field or button)
    label component
    label component
    import java.awt.*;
    import javax.swing.*;
    public class LayoutExample {
        public static void main(String[] args) {
            JPanel p = new JPanel(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.fill = GridBagConstraints.HORIZONTAL;
            gbc.anchor = GridBagConstraints.NORTH;
            gbc.insets = new Insets(0,5,0,0);
            //row 0
            gbc.gridy = 0;
            gbc.gridx = 0;
            p.add(new JLabel("label 0", JLabel.RIGHT), gbc);
            gbc.gridx = 1;
            p.add(new JTextField("field row 0", 20), gbc);
            //row 1
            gbc.gridy = 1;
            gbc.gridx = 0;
            p.add(new JLabel("label 1", JLabel.RIGHT), gbc);
            gbc.gridx = 1;
            p.add(new JTextField("field row 1", 20), gbc);
            //row 2
            gbc.gridy = 2;
            gbc.gridx = 0;
            p.add(new JLabel("longer label 2", JLabel.RIGHT), gbc);
            gbc.gridx = 1;
            p.add(new JButton("row 2"), gbc);
            //row 3
            gbc.gridy = 3;
            gbc.weighty = 100;
            gbc.gridx = 0;
            p.add(new JLabel("label 3", JLabel.RIGHT), gbc);
            gbc.gridx = 1;
            p.add(new JButton("row 3"), gbc);
            display("LayoutExample", p);
        static void display(String title, Component c) {
            JFrame f = new JFrame(title);
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(c);
            f.pack();
            f.setLocationRelativeTo(null);
            f.show();
    }Resize the frame. the components remain centred horizontally but anchored to the north (that's the effect of weighty).
    Of course, your mileage may vary, but don't give up on GridBagLayout. It reminds me of that 60's song, "If you want to be happy for the rest of your life (get yourself and ugly wife)"...

  • UDO OBJECT+ PRINT LAY OUT DESIGHNER

    Hi Friends
      I created a Sales invoice Udo Form. now i need to create invoice using Print lay out desighner. How can it possible . Any one can help me
    thanks

    Hi,
    U cannot have the same PLD fucntionality for ur UDO screens a work around is to add a PLD report which is created by code, Generally the thing i do is use a Crystal report  in place of the PLD. And open the report for user preview on the click of the Menu-Print Preview toolbar button.
    Hope it helps,
    Vasu Natari.

  • Adding a column in the Universe level without losing the Report Lay out

    Hi all,
    I have one universe with three universes built on it. Now, I want to add a column to one of the tables in the universe. For that, I selected the table and gave 'Refresh the structure'. The column got added in the workspace of the universe. When I drag and drop the table to the class & objects panel, it got added to the class/table in the panel. I saved and exported the universe.
    When I do like above, and open the report in the BO XI R3.1 webi front end, the report throws the following error:
    'Universe contains unresolved objects' and the report lay out is lost. All the three reports built on this universe is throwing the same error.
    Please let me know if there is any other way to retain the report lay out and add the column in the universe level.
    Thanks in advance
    - Regards,
      Arun

    Welcome to the sometimes frustrating world of working with dates against SAP BW via BusinessObjects!
    Your best bet here is to have a financial calendar table in a database and build a new query against that. Return Week Number as a detail of date and then merge the date dimensions.

  • Report web lay out creating error

    Hi
    Version - Reports Builder (9.0.4.2.0)
    OS -Windows XP ( SP3)
    When going to create a report (web lay out) final stage in the wizard (After pressing finish button) I get the following errors.
    (database in a separate server (10gR2) )
    REP-0069: Internal error
    REP:0 : Line #1 , <%@taglib uri="/WEB-INF/lib/reports_tld.jar" prefix="rw"%>
    Error: java.io.FileNotFoundException: c:\document and settings\shabar\local settings\temp\docroot\WEB-INF\lib\reports_tld.jar
         [The system cannot find the path specified]
    REP-6203: Unable to parse template file: rwbeige.html
    REP-50003: Bad parameter. settings/temp/docrootEven when try to open web source of a working paper lay out report Following error pops up and after that it shows the coding
    REP-0069: Internal error
    REP:0 : Line #41 , <%@taglib uri="/WEB-INF/lib/reportstld.jar" prefix="rw"%>
    Error: Prefix: rw has been used before the tag lib directives. Use a different prefix or move the taglib directive above any references to this prefix.What could be the reason.
    rgds
    shabar
    Edited by: shabar on Jan 4, 2010 1:59 AM

    Hello,
    You can use "Process Monitor" to generate a trace that may help to find where is the problem :
    http://technet.microsoft.com/en-gb/sysinternals/bb896645.aspx
    Regards

  • Buttons showing in panel help

    HI,
    This was my final year project and im trying to tidy it up a bit so I can add it to my protfolio but im having a big problem with the following:
    I have several panels all in a container, one is a button panel and one is a screen which shows an algorithm running. When you press or hover over a button in the button panel, it is displayed in the top left corner of the screen panel.
    the applet is here: http://homepage.ntlworld.com/k.wood143/FinalCopy/algo.html
    to get to the source just take off algo.html
    the classes you want are algoApp.java, and /runjava/GrahamScan.java
    any help or questions will be greatly appreciated, thanks in advance

    this edited version of your code does not show the buttons in the panel. The problem was your incorrect implementation of JPanels. You should never override paint(..) but paintComponent(..) instead. your implementation would have been ok for AWT but not Swing. get rid of all of your update and paint functions. put your 'update' code in paintComponent() save the call to repaint(). The DefaultPoints Panel is unnecessary. here is a revision of GrahamScan:
    package runjava;
    * Author Paul wood
    * This class is a JPanel used to display all of the steps
    * involved in the Grahams Scan algorithm. It addds an animation
    * feature to the JPanel using threads
    import javax.swing.JOptionPane;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    public class GrahamScan extends JPanel implements Runnable {
         //Edited by BlairTheMagician
         static int[][]coords = new int[][]{ {20, 90}, {100, 140}, {25, 200}, {150, 140},
                        {120, 220}, {115, 200}, {150, 55}, {125, 120},
                        {200, 140}, {250, 210},{220, 265}, {240, 240} };
         // Create an array of type Point
         static Point[] defaultPoints = new Point[coords.length];
         static
              //     add the points of the coords 2d array into the point array
             for(int i = 0; i < defaultPoints.length; i++)
                 defaultPoints[i] = new Point(coords[0],coords[i][1]);
         }// end edit by the Magician
    // initialise constants used for button presses
    public final static int COMPLETE = 1;
    public final static int ANCHOR = 2;
    public final static int ANGLE = 3;
    public final static int CONVEX = 4;
    public final static int ANIMATION = 5;
    public final static int STOPANIM = 6;
    public final static int STEP = 7;
    public final static int BUILD = 8;
    private int complete;
    private int anchor;
    private int angle;
    private int build;
    private int convex;
    private int step;
    private int nextStep;
    Point test1;
    Point test2;
    // these are used to get the sets of points
    DefaultPanel defaultPanel;
    OwnPointsDemo ownPointsPanel;
    Point[] points;
              // this is still not workink
    //Point[] points = ownPointPanel.points;
    int draw = 2;
    int count = 2;
    int val = 0;
    int[][] lineDraw;
    boolean completeHull = false;
    int start = 0;
    // default delay
    int delay = 1000;
    // animation stuff
    int frameNumber = 0;
    volatile Thread animatorThread = null;
    boolean threadSuspended = false;
         // create an array to hold the final convex hull points
         Point[] convexHull;
         ArrayStack S;
    public GrahamScan(DefaultPanel defaultPanel, OwnPointsDemo ownPointsPanel )
    // add demo panel
    // JPanel grahamScanPanel = new JPanel();
    this.defaultPanel = defaultPanel;
    this.ownPointsPanel = ownPointsPanel;
    points = defaultPanel.points;
    convexHull = new Point[points.length];
         S = new ArrayStack(points.length);
    //Point[] points = ownPointPanel.points;
    lineDraw = new int[points.length][points.length];
    public void startAnimation()
    //Create and start the animating thread.
              if (animatorThread == null) {
                   animatorThread = new Thread(this);
                   animatorThread.start();
    public void stopAnimation() {
    //Stop the animating thread.
    if (animatorThread != null) {
                   animatorThread = null;
         public void run()
              final Thread currentThread = Thread.currentThread();
              reset();
              step = STEP;
              while( animatorThread == currentThread) {
                   try{
                        currentThread.sleep(delay);
                        synchronized(this) {
                             while (threadSuspended && animatorThread == currentThread)
                                  wait();
                   }catch( InterruptedException ex ){}
                   frameNumber++;
                   nextStep++;
                   repaint();
    public void paint( Graphics g )
         update(g);
         public void paintComponent( Graphics g )
         Graphics2D g2 = (Graphics2D)g;
    //super.paint( g2 );
         g2.setColor(Color.white);
         g2.fillRect(0,0,this.getWidth(),this.getHeight());
         g2.setColor(Color.black);
         // edit by BTM begin
         // draw default points
         for(int i = 0; i < defaultPoints.length; i++)
    g2.fillOval( defaultPoints[i].x, defaultPoints[i].y, 4, 4 );
         // end edit by BTM
    // initialise a polygon for visual testing of the algorithm
    Polygon polygon1 = new Polygon();
    g2.drawString("frame = " + frameNumber, ( 200 ),( 300 ) );
    if( anchor == ANCHOR )
              // now start the algoithm by finding the anchor point
              findAnchorPoint();
              g2.setColor(Color.blue);
              g2.drawString("<-- Anchor point", ( points[0].x + 5 ),( points[0].y +5 ) );
         if( angle == ANGLE )
              // next sort the array into angular order
              angleSort( points );
              for(int i = 1; i < points.length; i++)
              g2.drawLine(points[0].x, points[0].y, points[i].x, points[i].y );
    if( step == STEP )
              g2.drawString("step = " + nextStep, ( 100 ),( 300 ) );
              if( nextStep == 1 )
                   anchor(ANCHOR);
                   // this is needed to stop the image being repainted until
                   // step is pressed again
                   nextStep++;
              else if( nextStep == 3 )
                   angle( ANGLE );
              // this is needed to stop the image being repainted until
                   // step is pressed again
                   nextStep++;     
              else if( nextStep == 5 )
                        buildConvex( BUILD );
                        // this is needed to stop the image being repainted until
                   // step is pressed again
                   nextStep++;      
    if( build == BUILD )
         convexHull( points );
                   if (completeHull == true)
                        // add the points in the point array to the polygon
         for ( int i = 0; i < convexHull.length && convexHull[ i ] != null; i++ )
         polygon1.addPoint( convexHull[ i ].x, convexHull[ i ].y );
         // draw the polygon
         g2.drawPolygon( polygon1 );
    else
    //     g2.drawLine(points[0].x, points[0].y, points[1].x, points[1].y);
         test1 = S.top();
                        test2 = S.secTop();
                        if( val < 1 )
                             lineDraw[0][0] = points[0].x;
                             lineDraw[0][1] = points[0].y;
                        //     lineDraw[1][0] = points[1].x;
                        //     lineDraw[1][1] = points[1].y;
                             lineDraw[1][0] = test2.x;
                             lineDraw[1][1] = test2.y;
                             lineDraw[2][0] = test1.x;
                             lineDraw[2][1] = test1.y;
                             val++;
                        if(test1.x == lineDraw[draw][0] && test1.y == lineDraw[draw][1] )
                             //just draw what we've already got
                             for( int i = 1; i < lineDraw.length && lineDraw[i][0] > 0; i++ )
                                  g2.setColor( Color.blue );
                                  g2.drawLine(lineDraw[i-1][0], lineDraw[i-1][1], lineDraw[i][0], lineDraw[i][1] );
                        else
                             //add to lineDraw then draw lines
                             lineDraw[draw][0] = test1.x;
                             lineDraw[draw][1] = test1.y;
                             lineDraw[draw][0] = test2.x;
                             lineDraw[draw][1] = test2.y;
                             for( int i = 1; i < lineDraw.length && lineDraw[i][0] > 0; i++ )
                                  g2.setColor( Color.blue );
                                  g2.drawLine(lineDraw[i-1][0], lineDraw[i-1][1], lineDraw[i][0], lineDraw[i][1] );
         g2.setColor( Color.red );     
                        g2.drawLine(test1.x, test1.y, test2.x, test2.y);
    if( convex == CONVEX )
         // finally find which points are on the convex hull
              testMeth( points );
    // add the points in the point array to the polygon
    for ( int i = 0; i < convexHull.length && convexHull[ i ] != null; i++ )
    polygon1.addPoint( convexHull[ i ].x, convexHull[ i ].y );
    // draw the polygon
    g2.setColor(Color.blue);
    g2.drawPolygon( polygon1 );
    // these next methods all relate to button presses in he main AlgoApp class
    public void anim ( int animation )
         convex = 0;
         angle = 0;
         anchor = 0;
         if( animation == ANIMATION )
              threadSuspended = false;
    startAnimation();
         else if( animation == STOPANIM )
              threadSuspended = true;
    stopAnimation();
    public void anchor ( int anchorPoint )
         convex = 0;
         angle = 0;
         anchor = anchorPoint;
         repaint();
    public void angle ( int angleSort )
         convex = 0;
         angle = angleSort;
         repaint();
    public void step ( int stepByStep )
         convex = 0;
         step = stepByStep;
         nextStep++;
         repaint();
    public void buildConvex( int buildHull )
         angle = 0;
         build = buildHull;
         repaint();
    public void convex ( int convexHull )
         angle = 0;
         convex = convexHull;
         repaint();
    public void sliderValue( int slider )
         delay = slider;
    public void reset()
         complete = 0;
         anchor = 0;
         angle = 0;
         build = 0;
         convex = 0;
         step = 0;
         nextStep = 0;
         frameNumber = 0;
         start = 0;
         draw = 2;
         count = 2;
         val = 0;
         completeHull = false;
         // used to delete lineDraw array so it redraws from the start
         for( int i = 0; i < lineDraw.length; i++)
              lineDraw[i][0] = 0;
              lineDraw[i][1] = 0;
         repaint();
    *This is where Graham's Scan algorithm is
    // first we find the anchor point
    public void findAnchorPoint()
    int min = points[0].y;
    int max = points[0].x;
    int anchorPoint = 0;
    int anchorIndex = 0;
    for (int i = 0; i < points.length && points[i] != null; i++)
    if (points[i].y > min)
    min = points[i].y;
    max = points[i].x;
    anchorPoint = i;
    else if (points[i].y == min)
    if (points[i].x > max)
    min = points[i].y;
    max = points[i].x;
    anchorPoint = i;
    // puts the anchor point at the beginning of the array
    swapPoint( points, anchorPoint, anchorIndex );
    public void swapPoint( Point pointArray[], int first, int second )
    Point hold;
    hold = pointArray[ first ];
    pointArray[ first ] = pointArray[ second ];
    pointArray[ second ] = hold;
    public void swapDouble( double doubleArray[], int first, int second )
    double temp;
    temp = doubleArray[ first ];
    doubleArray[ first ] = doubleArray[ second ];
    doubleArray[ second ] = temp;
    public double[] arraySort(double sortArray[])
    for( int pass = 0; pass < sortArray.length; pass++)
    for(int i = 2; i < sortArray.length; i++)
    if(sortArray[i] > sortArray[i-1] )
    swapPoint(points, i, i-1);
    swapDouble(sortArray, i, i-1);
    return sortArray;
    // next we calculate the angles
    public void angleSort( Point arr2[] )
    double angleArray[] = new double[arr2.length];
    double orderArray[] = new double[arr2.length];
    int indexOfAngle = 0;
    // works out angle of every point with x0 and y0 as the anchor point
    for (int i = 0; i < arr2.length; i++) {
    double pointAngle = Math.atan2((arr2[i].y - arr2[0].y), (arr2[ i ].x - arr2[0].x));
    // if its on the line with the anchor point at 180 degrees, this equals PI.
    // to make this come last in the array change PI to minus PI
    if ( pointAngle == Math.PI)
    pointAngle = -Math.PI;
    angleArray[i] = pointAngle;
    // call sortArray to sort the array angularly
    orderArray = arraySort(angleArray);
         // finally we claculate the final convex hull
    public void convexHull(Point stackArr[] )
    float leftCheck;
    if ( start == 0 )
              S.push(stackArr[0]);
              S.push(stackArr[1]);
              start += 1;
         if ( draw < stackArr.length )
              Point pt1 = S.top();
              Point pt2 = S.secTop();
              leftCheck = isLeft(pt1,pt2,stackArr[draw]);
              if ( leftCheck > 0)
                   S.push(stackArr[draw]);
                   count++;
                   draw++;
              else
              S.pop();
              count--;
         if ( draw == stackArr.length )
    completeHull = true;
              // stack called temp is used to get elements output in the correct order
              ArrayStack temp = new ArrayStack(stackArr.length);
              for ( int counter = 0; counter < count; counter++ )
              Point tempPoint = S.pop();
              temp.push(tempPoint);
              // put the coordinate onto final convex hull array
              for (int j = 0; j < count; j++)
              convexHull[j] = temp.pop();
              draw++;
    // this testMeth is used to allow the Get Convex Hull button to work
    public void testMeth(Point stackArr[] )
    int count = 2;
    int i = 2 ;
    float leftCheck;
    ArrayStack S = new ArrayStack(stackArr.length);
    S.push(stackArr[0]);
    S.push(stackArr[1]);
    while ( i < stackArr.length)
    Point pt1 = S.top();
    Point pt2 = S.secTop();
    leftCheck = isLeft(pt1,pt2,stackArr[i]);
    if ( leftCheck > 0)
    S.push(stackArr[i]);
    count++;
    i++;
    else
    S.pop();
    count--;
    // stack called temp is used to get elements output in the correct order
    ArrayStack temp = new ArrayStack(stackArr.length);
    String testOutput = "\nConvex Hull = \n ";
    for ( int counter = 0; counter < count; counter++ )
    Point tempPoint = S.pop();
    temp.push(tempPoint);
    // put the coordinate onto final convex hull array
    for (int j = 0; j < count; j++)
    convexHull[j] = temp.pop();
    //==============================================================================
    // Copyright 2001, softSurfer (www.softsurfer.com)
    // This code may be freely used and modified for any purpose
    // providing that this copyright notice is included with it.
    // SoftSurfer makes no warranty for this code, and cannot be held
    // liable for any real or imagined damage resulting from its use.
    // Users of this code must verify correctness for their application.
    // This is a C++ implementation which I, Paul Wood have modified slighty
    // for use in Java (07/03/2005).
    // isLeft(): tests if a point is Left|On|Right of an infinite line.
    // Input: three points P0, P1, and P2
    // Return: >0 for P2 left of the line through P0 and P1
    // =0 for P2 on the line
    // <0 for P2 right of the line
    public float isLeft( Point P0, Point P1, Point P2 )
    return (P1.x - P0.x)*(P2.y - P0.y) - (P2.x - P0.x)*(P1.y - P0.y);
    //==============================================================================

  • Making lay-outs in Dreamweaver

    Hello;I have been studying 2 Dreamweaver learning books(and a lot of “background books“(php) the past 3 years.In one of them the author explained the different ways of using lay-outs in DW.(the “ready to go” css lay-outs,tables,etc.) However:I want to make my own designs,instead of using pre-designed lay-outs.(and tables)Therefore the possiblity of using AP divs seemed to be the best way. A disadvantage of the AP divs is,of course,that the divs are absolutely positioned,so that on a small screen the content is moving to the right. Because of the fact that making designs using AP divs,just like using a pencel or brush like a real painter does,makes designing a lot of fun(instead of playing in the plain code) I kept on using the AP divs,but instead of “position:absolute” I have changed this into “position relative”. I have also used a container in which I put all the other divs,just for keeping it all centered. At first site,it looked all fine,but when inserting other stuff,like plain tekst,extra code or images,everything went nuts,a bit like when using a table:all the divs weren’t positioned nicely anymore and I had to re-place everything again. The changes kept going on and,especially in the design-mode,it’s all messed up. So my question is: What lay-out method do you all,as experienced webdesigners,prefer to use,according to modern standards??(and still make designing a fun thing to do,without programming in the code) Of course with the use of Dreamweaver and all its toolbars,buttons and features. I really hope you have the answer for me!!! Many thanks for the help you are giving me!! Greetings igor

    Hi Again
    I tend to use whatever css based layout type I think is best suited for the design, (never tables for layout and absolute positioned items with caution, see my answer to your previous thread regarding % values) this may even include using 'trial' feature such as html 5 and css3 with jQuery or whatever.
    The thing is with layouts, is to decide how you wish your page to look and function, then work out how-to-do it, that for me is what keeps it interesting. As an example I have even experimented with using a flash swf as a resizeable background image with animation, (works, but the browser must be resized by 1px to force the swf to resize on initial load of page).
    PZ

  • Help laying out a simple page

    I need a page where I have a tree on the left and a data table next to it on the right. I'd like the tree and the data table to have the same vertical starting point so that the tree looks something like the first column of the data table:
    +------------------------------------------------------------------+
    |  Tree Header |                Table header                       |
    -------------------------------------------------------------------+
    |  - Root      | Col Header |  Col Header  |  Co Header | Col Head |
    |   |          |---------------------------------------------------|
    |   - Node     |  value     |   value      |  value     |  value   |
    |   |          |  value     |   value      |  value     |  value   |
    |   | - Leaf   |  value     |   value      |  value     |  value   |
    |   |          |  value     |   value      |  value     |  value   |
    |   + Node     |  value     |   value      |  value     |  value   |
    ...I'm trying to lay this out with a grid panel with two columns and then a tree control in the first colum and a data table control in the second column, but I am having a heck of a time to get this to layout correctly. I'd like the tree area to consume about 25% of the space and the data table to consume about 75% of the space and I want them to pack towards north west. I could easily do this with Swing but I'm having a difficulty here.
    Any help will be greatly appreciated.

    Dave Saunders,
    I am eternally grateful to you. You have no idea what you've saved me from and you've given me time to salvage whatever is left of my weekend.
    You are a saint of a man. Thank you :)

  • How do I sign out of my account after logging in? There is no sign out button when signing into my apple account using safari

    Every time I sign into my apple ID account online I cannot log out by clicking a "sign out" button.
    This is quite strange. Closing the browser window doesn't automatically log me out either.
    I know with itunes there is a sign out or log out button but not with signing in your account online.
    I had to change some personal information which is why I noticed it.

    I'm on a PC.  Maybe that makes a difference.  And I went directly to apple.com; I did not launch the store from Itunes -- so perhaps that's the difference.
    Whatever it is I am never presented with a command bar that looks anything like yours.
    The following image is from when I am actually accessing my account data:
    No log-in; no screenname; no log-out -- And yet I am in a secure domain.

  • How can I use the button in one panel to control the other panel's appearing and disappearing?

    How can I use the button in one panel to control the other panel's
    appearing and disappearing? What I want is when I push the button on
    one button . another panel appears to display something and when I
    push it again, that the second panel disappears.

    > How can I use the button in one panel to control the other panel's
    > appearing and disappearing? What I want is when I push the button on
    > one button . another panel appears to display something and when I
    > push it again, that the second panel disappears.
    >
    You want to use a combination of three features, a button on the panel,
    code to notice value changes using either polling in a state machine of
    some sort or an event structure, and a VI Server property node to set
    the Visible property of the VI being opened and closed.
    The button exists on the controlling panel. The code to notice value
    changes is probably on the controlling panel's diagram, and this diagram
    sets the Visible property node of a VI class property node to FALSE or
    TRUE to show or
    hide the panel. To get the VI reference to wire to the
    property node, you probably want to use the Open VI Reference node with
    the VI name.
    Greg McKaskle

  • Why does ical on icloud have a different lay out than on my mac

    Why does iCal on my MacBook Pro have a different lay out than on iCloud? I like the iCloud layout better, the only missing niceties is the year calendar. How do I get both iCals to look the same? The ideal iCal? The one from iCloud WITH the year calendar.

    Do a malware check with some malware scanning programs on the Windows computer.<br />
    You need to scan with all programs because each program detects different malware.<br />
    Make sure that you update each program to get the latest version of their databases before doing a scan.<br /><br />
    *http://www.malwarebytes.org/mbam.php - Malwarebytes' Anti-Malware
    *http://www.superantispyware.com/ - SuperAntispyware
    *http://www.microsoft.com/windows/products/winfamily/defender/default.mspx - Windows Defender: Home Page
    *http://www.safer-networking.org/en/index.html - Spybot Search & Destroy
    *http://www.lavasoft.com/products/ad_aware_free.php - Ad-Aware Free
    See also:
    *"Spyware on Windows": http://kb.mozillazine.org/Popups_not_blocked
    Please update Firefox to the latest version via "Help > Check for Updates or Help > About Firefox"<br />
    The Firefox version that you use is no longer maintained with security and stability updates.<br />
    Using unsupported Firefox versions is at your own risk and makes you vulnerable to attacks.<br />
    *Firefox 7.0.x: http://www.mozilla.com/en-US/firefox/all.html

  • After installing the update to version 9 of Firefox, I can access some items on my toolbar. The log out button on my GMail can no longer be accessed, what's wrong.

    None of the toolbar items, on the log out row, on my gmail account are active anymore. I also had this problem with my discover account, I couldn't use the log out button there either. When I called Discover, they told me their site was not yet updated for for version 9 of Firefox.

    Both the Yahoo! Toolbar extension and the Babylon extension have been reported to cause an issue like that. Disable or uninstall those add-ons.
    * https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes

  • On iPhoto, I can no longer access the 'Classic' option which would lay out my photos on the page. It will send them as attachments only. I need the page layout for my work. Any thoughts as to why this has changed?

    On iPhoto, I can no longer access the 'Classic' option which would lay out my photos on the page. It will send them as attachments only. I need the page layout for my work. Any thoughts as to why this has changed? It used to fully lay out the photos so I could add notes and detailed information before I sent them. I am thinking it is something simple that I have just missed...

    The "Photos" view has been replaced by the Media Browser.
    Most applications will show you the Photos icon in the Sidebar, when you need to select photos in a file chooser dialoge. Mail, Safari, the iWork apps. See Terence Devlin's User Tip: How to Access Files in iPhoto
    For example, in the File > Open dialogue in Preview I am seeing this in the sidebar.

  • Sub: Tax Combinatiom. Tax rate, tax Amount in the print lay out design of t

    Dear all,
    Sub: Tax Combinatiom. Tax rate, tax Amount in the print lay out design of the A/R Invoice
    I have to Create a Print Lay out design of the A/R invoice for the Indain standrad please provide me some solutions for the following problems to locate the Tax combinations,Tax rate  and the Tax amount in the PLD  A/R Invoice ,
    PACAKGE  SAP B1 2005B
    Need a standrad solution as per the requriment
    Eg: Row Level
    Tax Code created is BED+VAT
    Tax combination details is
    Name of Tax type   Rate
    Excise                     16%
    Ecess                    2%
    Hcess                    1%
    VAT                       4%  
    Row No     Item  Qty   UnitPrice  Tax code  Total(LC)    Tax Amount
      1             X      10     10000      BED+VAT   100000      21139
                                             (Excise =16000,Ecess=320, Hcess=160, VAT=4659)
    2              Y      5      20000      BED+VAT    200000       42278
                                            (Excise =32000,Ecess=640,  Hcess=320, VAT=9318)
    In Print  Lay out Design Requried is the deatils of Tax code combination , Rate and the Tax Amount in the followig way 
    Excise    16%   =48000
    Ecess     2%    =960
    Hcess     1%    =480
    VAT       4%    =13977
    Please send the feedback as early as possible urgently requried
    for the further details send the feedback
    Reagrds
    Mr.Chitrasen

    Hi experts,
           Pls anybody have an answer to my question, i'll be very thankfull to u,
                     I wanted to display the Tax Break ups in Invoice say,
    ECess            25
    Vat                 56
    Excise duty    32
    I've tried a lot with many of the SAP Forum thread but the results is not satisfactory..am using SAP Business One 2007 b
    pls anybody who can guide me with step by step PLD creation for this problem.
    I done the below steps in PLD
    In Repetitive area 1
    Field_1:  Table-> OSTA                    
                  Column-> Type                               
    Field_2 : Table-> OSTA                  
                  Column -> Code                               
    Field_3:  Table-> OSTA                   
                  Column-> Rate
    Field_4:  Table-> OSTA                  
                  Column-> Name  
    Field_5:  Table-> A/R Invoice Tax amount per document
                    Column-> Tax amount
    Field_6 : Table-> A/R Invoice Tax amount per document
                    Column-> Base amount
    Field_7 :  Formula ->  Field_6 * Field_8
    Field_8 :   Formula->  Field_1==1
          NOW I SORTED REPETITVE AREA 1 WITH 'SALES TAX AUTHORITIES;cODE' AND TICKED THE CHECK BOX 'SUMMARY'
        AND MADE THIS REPETITIVE AREA INVISIBLE.
    IN Repetive area footer
    F_01 :    Formula->   Field_4       
    F_02 :    Formula->   Concat(Round(F_rate,0), '%')
    F_03 :    Formula->   Round(ColSum("F_tax_amount"),2)
      I grouped the Repetitive area footer as Group 1
                                here i get the result but the Tax Rows are repeating and Tax amount varies for VAT for each rows
    pls help me guys...          
                   Thanks in advance,
                   Dinesh
    Edited by: Dinesh S on Dec 23, 2011 1:28 PM

Maybe you are looking for

  • CD/DVD drive does not play entire disk

    Greetings! I have an iMac (2009 acquired) 3.06GHZ - Mac OSX 10.6.8 - 4GB mem. I am experience CD/DVD drive problem with some CDs with photos: The drive starts accessing the disk but at some point (say, midway through a 300 pic cd) seems to stop recog

  • Published website loads in layers

    My website loads in layers, but I do not have very many pictures on my pages, so the problem shouldn't be that I have too many pictures. It also isn't loading slowly, persay, it just loads layer by layer, so it looks weird. The site is http://web.me.

  • Drop down box for the selection screen field of the classical report

    Hi all. i want to have the drop down list to choose from, for the region(table:zbwcntry-field:zregion1) on the selection screen. what is to be added to the code for this requirement.Also,please note that this is the classical report. thanks for this

  • New LiveCycle Form Design Question

    I'm an using LIveCycle v8.2.1. Currently we have several Word Perfect forms that are build off of macros. The user will open the Word Perfect form & a box will pop up asking different questions such as name, address, location, etc & after the questio

  • Can anyone spot the error in this script for iTunes?

    This AppleScript is designed to copy the Name and Artist of an iTunes track, then populate the Album Artist field with both, separated with an oblique. But when I run the script in iTunes, it only pastes the Artist name in to the Album Artist field a