HELP!!! save position of the components!!!

Hi!
I have a JLayeredPane where I insert some images. I move this images. BUT when I press a button (that invoke a ActionListener) all the images return at initial position!!!
THE PROGRAM:
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;
import javax.swing.text.*; //per StyledDocument
import javax.swing.BorderFactory;
import javax.imageio.*;
public class mio implements ActionListener,MouseMotionListener,MouseListener{
JTextArea statusInfo; //info da passare a PROGRAMMA TODO
JTextArea PASpar; // PARAMETRI X TODO
JTextArea PASimage; //IMMAGINI X TODO
Color whitex = new Color(255,255,255);
Color bluex = new Color(100,105,170);
Color bluexx = new Color(100,150,170);
Color redx = new Color(255,0,0);
JFrame frame; //contiene tutto
JFrame frameP;
JMenuBar menu;
JMenu fileMenu;
JMenuItem nuovo;
JMenuItem apriimgf;
JMenuItem aprimosf;
JMenuItem salva;
JMenuItem stampa;
JMenuItem esci;
JMenu modMenu;
JMenuItem annulla;
JMenu helpMenu;
JMenuItem help;
JPanel panel; //contiene oggetti entro menu
JPanel panel2;
JPanel panel3; //xbottoni
JLayeredPane pane;
JTextArea spiega;
JTextArea dico2;
JLayeredPane panelpane; //dove carico img
JButton apriimg;
JButton chiudi;
JButton aprimos;
JButton ok;
JButton mosaica;
JButton superR;
JButton salvab;
JButton migliora;
JButton nuovob;
int _dragFromX = 0;    // pressed this far inside ball's
int _dragFromY = 0;
boolean _canDrag  = false;
int i;
int px;
int py;
int mousex;
int mousey;
int rifno;//x img d riferimento
int scelta; //1 = immagini 2=mosaico
int Nimg; // NUMERO IMG KE INSERISCO <= 12
JLabel image;
ImageIcon icon;
int ximg, yimg; //posizione img in panel
int xgrid,ygrid; //griglia panel
int[] ximgs,yimgs; //x,y img
JLabel[] images;
int hicon,wicon; //h w img
int[] wimgs,himgs;
int muovi; //img da muovere nell'array
     public final static int ONE_SECOND = 500; ////
     private JProgressBar progressBar;
     private javax.swing.Timer timer;
     private JButton startButton;
     private LongTask task;
     private JTextArea taskOutput;
static private String newline = "\n";
// =================== MAIN
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() {
mio m = new mio();
/*public static void main(String argv[]){
     mio m = new mio();
// ================ COSTRUTTORE
public mio(){
     rifno = 0;//no img d rif
     Nimg = 0;
     frame = new JFrame("interfaccia");
     PASpar = new JTextArea();
     PASimage = new JTextArea();
     menu = new JMenuBar();
     menu.setOpaque(true);
     menu.setBackground(bluex);
     // ********* Menu file *********
     fileMenu = new JMenu("File");
     fileMenu.setMnemonic(KeyEvent.VK_F);
     nuovo = new JMenuItem("Nuovo");
     nuovo.setMnemonic(KeyEvent.VK_N);
     apriimgf = new JMenuItem("Apri immagini");
apriimgf.setAccelerator(KeyStroke.getKeyStroke(
KeyEvent.VK_1, ActionEvent.ALT_MASK)); //alt+1
     aprimosf = new JMenuItem("Apri mosaico");
salva = new JMenuItem("Salva");
     salva.setMnemonic(KeyEvent.VK_S);
     esci = new JMenuItem("Esci");
     esci.setMnemonic(KeyEvent.VK_E);
     //********* Menu Modifica ***********
     modMenu = new JMenu("Modifica");
     modMenu.setMnemonic(KeyEvent.VK_M);
     annulla = new JMenuItem("Annulla");
     annulla.setMnemonic(KeyEvent.VK_A);
     // ********* Help Menu *************
     helpMenu = new JMenu("HELP");
     help = new JMenuItem("Help");
     menu.add(fileMenu);
     fileMenu.add(nuovo);
     fileMenu.add(apriimgf);
     fileMenu.add(aprimosf);
     fileMenu.add(salva);
     fileMenu.addSeparator();
     fileMenu.addSeparator();
     fileMenu.add(esci);
     menu.add(modMenu);
     modMenu.add(annulla);
     menu.add(helpMenu);
     helpMenu.add(help);
     // ActionListener x ogni voce d menu
     nuovo.addActionListener(this);
     apriimgf.addActionListener(this);
     aprimosf.addActionListener(this);
     salva.addActionListener(this);
     esci.addActionListener(this);
     annulla.addActionListener(this);
     help.addActionListener(this);
     frame.setJMenuBar(menu);//in frame menu
     panel=new JPanel(new BorderLayout(2,2));
     frame.getContentPane().add(panel);
     spiega = new JTextArea(" 1. Aprire TUTTE le immagini da mosaicare"+ newline +" Oppure il mosaico da migliorare"+newline,3,40);
     spiega.setEditable(false);
     spiega.setBorder(BorderFactory.createLineBorder(Color.black));//bordo
     spiega.setBackground(bluex);
     panelpane = new JLayeredPane();
     panelpane.setPreferredSize(new Dimension(900,550));
     panelpane.setBackground(whitex);
     panelpane.setLayout(new GridLayout(0,4)); //max 12 img e occupano tutto subito
     panelpane.setBorder(BorderFactory.createLineBorder(Color.black));
     panelpane.addMouseListener(this);
     panelpane.addMouseMotionListener(this);
     xgrid = 225;
     ygrid =183;
     ximg = 0;
     yimg = 0;
     images = new JLabel[12];//immagini
     ximgs = new int[12];
     yimgs = new int[12];
     wimgs = new int[12];
     himgs = new int[12];
     panel3= new JPanel();
     panel3.setBackground(bluex);
     panel3.setLayout(new BoxLayout(panel3, BoxLayout.Y_AXIS));
     panel3.setBorder(BorderFactory.createLineBorder(Color.black));
     chiudi = new JButton("Chiudi applicazione");
     chiudi.addActionListener(this);
     chiudi.setBackground(bluex);
     // ******* 1 FRAME
     apriimg = new JButton("Apri immagine");
     apriimg.addActionListener(this);
     apriimg.setBackground(bluex);
     aprimos = new JButton("Apri mosaico");
     aprimos.addActionListener(this);
     aprimos.setBackground(bluex);
     ok = new JButton("Prosegui");
     ok.addActionListener(this);
     ok.setBackground(bluex);
     ok.setEnabled(false); //disabilito
     //****** 2 frame
     mosaica = new JButton(" Mosaica ");
     mosaica.addActionListener(this);
     mosaica.setBackground(bluex);
     mosaica.setVisible(false);
     superR = new JButton("Super-Risoluzione");
     superR.addActionListener(this);
     superR.setBackground(bluex);
     superR.setVisible(false);
     // ********* 3 frame
     salvab = new JButton(" Salva mosaico ");
     salvab.addActionListener(this);
     salvab.setBackground(bluex);
     salvab.setVisible(false);
     migliora = new JButton(" Migliora mosaico ");
     migliora.addActionListener(this);
     migliora.setBackground(bluex);
     migliora.setVisible(false);
     nuovob = new JButton(" Nuovo progetto ");
     nuovob.addActionListener(this);
     nuovob.setBackground(bluex);
     nuovob.setVisible(false);
     statusInfo = new JTextArea(3,40);
     statusInfo.setBorder(BorderFactory.createLineBorder(Color.black));
     statusInfo.setBackground(bluex);
     JScrollPane scrollArea = new JScrollPane(statusInfo);
     panel.add((spiega), BorderLayout.NORTH);
     panel.add((panelpane), BorderLayout.CENTER);
     panel.add((panel3), BorderLayout.EAST);
     panel.add((scrollArea), BorderLayout.SOUTH);
     panel3.add(apriimg);
     panel3.add(salvab);//3 frame
     panel3.add(new JSeparator(JSeparator.HORIZONTAL));
     panel3.add(aprimos);
     panel3.add(mosaica); // 2 frame
     panel3.add(migliora);
     panel3.add(new JSeparator(JSeparator.HORIZONTAL));
     panel3.add(ok);
     panel3.add(superR); // 2 frame
     panel3.add(nuovob); // 3 frame
     panel3.add(new JSeparator(JSeparator.HORIZONTAL));
     panel3.add(chiudi);
     frame.pack();
     frame.setVisible(true);
     frame.addWindowListener(new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
               System.exit(0);
}// chiude costruttore
// ================ metti mosaico
     public void mettiMosaico(){
          panelpane.removeAll();
          ImageIcon img1 = new ImageIcon("mosaico.jpg");
          Image imgesize1 = resize2Icon("mosaico.jpg"); // resize
          img1 = new ImageIcon(imgesize1);
          JLabel image1 = new JLabel(img1);
          image1.setLocation(200,10);
          panelpane.add(image1);
          panelpane.repaint();
// ================= RESIZE MOSAICO
     public Image resize2Icon(String image){
     Image img;
          Image inImage = new ImageIcon(image).getImage();
          int maxDim = 500;
          double scale = (double) maxDim / (double) inImage.getHeight(null);
          if (inImage.getWidth(null) > inImage.getHeight(null))
               scale = (double) maxDim / (double) inImage.getWidth(null);
          // Determine size of new image.
          //One of them
          // should equal maxDim.
          int scaledW = (int) (scale * inImage.getWidth(null));
          int scaledH = (int) (scale * inImage.getHeight(null));
          System.out.println(">> "
               + inImage.getSource().getClass()
               + " aspect ratio = "
               + scaledW + " , " + scaledH);
          img = inImage.getScaledInstance(scaledW , scaledH, Image.SCALE_SMOOTH);
     return img;
// ================= RESIZE IMAGES
public Image resizeIcon(String image){
     Image img;
          Image inImage = new ImageIcon(image).getImage();
          int maxDim = 180;
          double scale = (double) maxDim / (double) inImage.getHeight(null);
          if (inImage.getWidth(null) > inImage.getHeight(null))
               scale = (double) maxDim / (double) inImage.getWidth(null);
          // Determine size of new image.
          //One of them
          // should equal maxDim.
          int scaledW = (int) (scale * inImage.getWidth(null));
          int scaledH = (int) (scale * inImage.getHeight(null));
          System.out.println(">> "
               + inImage.getSource().getClass()
               + " aspect ratio = "
               + scaledW + " , " + scaledH);
          img = inImage.getScaledInstance(scaledW , scaledH, Image.SCALE_SMOOTH);
          return img;
// ================== img RIFERIMENTO
     public void imgRif(){
          frameP.setVisible(false);//tolgo frame
          rifno=1;
          spiega.setText (" Con il mouse indicare l'immagine di riferimento"+newline);
     }//fine imgRif
// ================== BARRA PROGRESS
     public void barraP(){
          final JFrame framePb = new JFrame("ELABORAZIONE in corso");
          framePb.setSize(300,1000);
          framePb.setBackground(bluex);
          statusInfo.append(" Elaborazione in corso... "+newline);
          JPanel panelPb=new JPanel(new BorderLayout());
          panelPb.setBackground(bluex);
          panelPb.setBorder(BorderFactory.createLineBorder(Color.black));
          panelPb.setPreferredSize(new Dimension(300,100));
          framePb.getContentPane().add(panelPb);
     task = new LongTask();
          progressBar = new JProgressBar(0, task.getLengthOfTask());
     progressBar.setValue(0);
     progressBar.setStringPainted(true);
     panelPb.add(progressBar);
     //Create a timer.
     timer = new javax.swing.Timer(ONE_SECOND, new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
          progressBar.setValue(task.getCurrent());
          String s = task.getMessage();
          if (task.isDone()) {
               Toolkit.getDefaultToolkit().beep();
               timer.stop();
                         statusInfo.append(" Eseguita elaborazione "+newline);
                         spiega.setText (" 4. Migliora, Salva, Nuovo progetto o Esci"+newline);
                         superR.setVisible(false);
                         mosaica.setVisible(false);
                         salvab.setVisible(true);
                         migliora.setVisible(true);
                         nuovob.setVisible(true);
                         framePb.setVisible(false);
               framePb.setCursor(null); //turn off the wait cursor
               progressBar.setValue(progressBar.getMinimum());
                         //panelpane.removeAll();
                         //inserisco mosaico creato
          framePb.pack();
          framePb.setVisible(true);
          framePb.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
     task.go();
     timer.start();
          framePb.addWindowListener(new WindowAdapter() {
               public void windowClosing(WindowEvent e) {
                    System.exit(0);
// ===================================================================================== EVENTI
public void actionPerformed(ActionEvent e) {
     Object source = e.getSource(); //chi ha invocato evento
// ====================================================================================== NUOVO
     if((source == nuovo)||(source == nuovob)){
          System.out.println("Nuovo");
          mio m = new mio();
// ====================================================================================== HELP
     if(source == help){
          System.out.println("Help");
          final JFrame framePh = new JFrame(" - H E L P - ");
          framePh.setSize(300,1000);
          JTextArea help=new JTextArea(" Help per utente! "+newline,5,40);
          help.setEditable(false);
          help.setBorder(BorderFactory.createLineBorder(Color.black));//bordo
          //help.setBackground(bluex);
          JButton escih = new JButton(" Esci ");
          escih.setBackground(bluex);
          escih.addActionListener(new ActionListener(){ //quando premo esci
          public void actionPerformed(ActionEvent e){
                         framePh.setVisible(false); // SQUALLIDO! esci meglio!
          framePh.getContentPane().add(help);
          framePh.pack();
          framePh.setVisible(true);
// ======================================================================================== APRI
     if((source == apriimgf) || (source == apriimg)){ //apri + img
          System.out.println("Apri");
          scelta=1; //immagini
          Image imgresize;
          JFileChooser fileChooser = new JFileChooser();
          fileChooser.addChoosableFileFilter(new ImageFilter());//filtro
          fileChooser.setAcceptAllFileFilterUsed(false);
          fileChooser.setAccessory(new ImagePreview(fileChooser));//anteprima
          fileChooser.setCurrentDirectory(new File("."));
     fileChooser.setMultiSelectionEnabled(true);
     int status = fileChooser.showOpenDialog(null);
          if (status == JFileChooser.APPROVE_OPTION) {
     File selectedFiles[] = fileChooser.getSelectedFiles();
               if (selectedFiles.length>12){
                    System.out.println("selezionati piu' di 12 img");
                    return;
               if (Nimg>12){
                    System.out.println("Ho piu' di 12 img");
                    return;
               //int imgora = Nimg + selectedFiles.length; //immagini totali caricate fin'ora
               int imgPrima = Nimg; //img prima di inserire le selezionate
               int imgIns = selectedFiles.length; //immagini inserite ora.
          for (int im=0,n=selectedFiles.length; im<n; im++) {
                    icon = new ImageIcon(selectedFiles[im].getAbsolutePath());
                    statusInfo.append(" Inserito: " + selectedFiles[im].getName() + newline);
                    int hicon = icon.getIconHeight();
                    int wicon = icon.getIconWidth();
                    if ((hicon>183)||(wicon>225)){
                         imgresize = resizeIcon(selectedFiles[im].getAbsolutePath()); // resize
                         icon = new ImageIcon(imgresize);
                    if (ximg>675){
                         if (yimg>366){
                              System.out.println(" TROPPE IMG!!! ");
                         else{
                         ximg=0;
                         yimg=yimg+ygrid;
                    image = new JLabel(icon);
                    image.setBounds(ximg,yimg,hicon,wicon);
                    //aggiorno dati IMMAGINI
                    yimgs[im+imgPrima]=yimg;
                    ximgs[im+imgPrima]=ximg;
                    images[im+imgPrima] = image;
                    himgs[im+imgPrima] = hicon;
                    wimgs[im+imgPrima] = wicon;
                    statusInfo.append("");
                    panelpane.add(images[im+imgPrima], new Integer(0),12-(im+imgPrima)); //ULTIMA SOPRA
                    //images[im+imgPrima].setLocation(ximgs[im+imgPrima],yimgs[im+imgPrima]);
                    ximg = ximg + xgrid;
                    Nimg=Nimg+1; //n img totale
                    ok.setEnabled(true); //abilito
                    aprimos.setEnabled(false); //abilito
                    spiega.setText (" 2.Con il mouse spostare le immagini creando un 'mosaico'"+newline);
// ============================================================================= apri mosaico
     if((source == aprimos)||(source == aprimosf)){
          System.out.println("Apri mosaico");
          scelta=2; //mosaico
          JFileChooser fileChooser = new JFileChooser();
          fileChooser.addChoosableFileFilter(new ImageFilter());//filtro
          fileChooser.setAcceptAllFileFilterUsed(false);
          fileChooser.setAccessory(new ImagePreview(fileChooser));//anteprima
          fileChooser.setCurrentDirectory(new File("."));
     fileChooser.setMultiSelectionEnabled(false);
     int status = fileChooser.showOpenDialog(null);
     if (status == JFileChooser.APPROVE_OPTION) {
     File selectedFile = fileChooser.getSelectedFile();
               icon = new ImageIcon(selectedFile.getAbsolutePath());
                    int hicon = icon.getIconHeight();
                    int wicon = icon.getIconWidth();
                    image = new JLabel(icon);
                    image.setBounds(ximg,yimg,hicon,wicon);
                    statusInfo.append("");
                    panelpane.add(image,new Integer(1),1);//dopo sopra
                    ok.setEnabled(true); //abilito
                    apriimg.setEnabled(false); //abilito
                    aprimos.setEnabled(false); //abilito
                    spiega.setText (" 2. Proseguire"+newline);
// =============================================================================== SALVA
     if(source == salva){
          System.out.println("Salva");
          try {
          FileOutputStream fos = new FileOutputStream ("info.doc"); //doc.ser
          ObjectOutputStream oos = new ObjectOutputStream (fos);
          String infoo = statusInfo.getText(); // NON E' GIUSTO!!!
          oos.writeObject(infoo);
          oos.flush();
          oos.close();
          statusInfo.append(" Salvato il progetto in: info.doc"+newline);
          } catch (IOException e1) {
               statusInfo.setText (" Unable to save");
               e1.printStackTrace(); //scrivo eccezione
// =============================================================================== PROSEGUI
     if(source == ok){
          System.out.println("Prosegui");
          apriimg.setVisible(false);
          aprimos.setVisible(false);
          ok.setVisible(false);
          mosaica.setVisible(true);
          panelpane.removeMouseMotionListener(this);
          if (scelta==1){
               superR.setVisible(true);
               panelpane.revalidate ();
               spiega.setText (" 3. Scegliere Mosaicatura o Super-Risoluzione"+newline);
          }else{
               panelpane.revalidate ();
               spiega.setText (" 3. Eseguire Mosaicatura"+newline);
// ================================================================================= ESCI
     if((source == esci)||(source==chiudi)){
          System.out.println("Esci");
          System.exit(0);
// =================================================================================== ANNULLA
     if(source == annulla){
          System.out.println("Annulla");
// ======================================================================================== MOSAICA
     if(source == mosaica){
          System.out.println("Mosaica");
          frameP = new JFrame("Parametri di Mosaicatura");
          frameP.setSize(800,800);
          frameP.setBackground(bluex);
          JPanel panelP=new JPanel(new GridLayout(1,0));
          panelP.setBackground(bluex);
          panelP.setBorder(BorderFactory.createLineBorder(Color.black));
          panelP.setPreferredSize(new Dimension(500,500));
          frameP.getContentPane().add(panelP);
          JPanel panelP0 = new JPanel(new FlowLayout()); //avvia
          panelP0.setBackground(bluex);
          panelP0.setBorder(BorderFactory.createLineBorder(Color.black));
          panelP.add(panelP0);
          JPanel panelP1 = new JPanel(new FlowLayout());//parametri
          panelP1.setBackground(bluex);
          //panelP1.setLayout(new BoxLayout(panelP1, BoxLayout.Y_AXIS));
          panelP1.setBorder(BorderFactory.createLineBorder(Color.black));
          panelP.add(panelP1);
          JPanel panelP2=new JPanel(new FlowLayout());
          panelP2.setBackground(bluex);
          panelP2.setBorder(BorderFactory.createLineBorder(Color.black));
          panelP.add(panelP2);
          //**************** panel 1 : PARAMETRI
          JTextArea dico3 = new JTextArea(" Parametri di miscelazione",10,40);
          dico3.setEditable(false);
          dico3.setBorder(BorderFactory.createLineBorder(Color.black));//bordo
          JRadioButton primo = new JRadioButton("First frame");
          primo.setActionCommand("first");
          primo.setSelected(true);
          primo.setBackground(bluex);
          JRadioButton secondo = new JRadioButton("Last frame");
          secondo.setActionCommand("last");
          secondo.setBackground(bluex);
          JRadioButton terzo = new JRadioButton("Average");
          terzo.setActionCommand("average");
          terzo.setBackground(bluex);
          JRadioButton quarto = new JRadioButton("Median");
          quarto.setActionCommand("median");
          quarto.setBackground(bluex);
          JRadioButton quinto = new JRadioButton("Feathering");
          quinto.setActionCommand("feathering");
          quinto.setBackground(bluex);
          final ButtonGroup group = new ButtonGroup(); //raggruppo x fare esclusione
          group.add(primo);
          group.add(secondo);
          group.add(terzo);
          group.add(quarto);
          group.add(quinto);
          // ******** panel 0 : avvia
          JTextArea dico = new JTextArea(" Se si vuole avviare la mosaicatura premere 'Avvia'" newline" in tal caso se non sono stati settati parametri verranno utilizzati quelli di default",10,40);
          dico.setEditable(false);
          dico.setBorder(BorderFactory.createLineBorder(Color.black));//bordo
          JButton ok1 = new JButton("Avvia");
          ok1.setBackground(bluex);
          ok1.addActionListener(new ActionListener(){ //quando premo ok ...
          public void actionPerformed(ActionEvent e){
                    String command = group.getSelection().getActionCommand();
               statusInfo.append(" Parametri di mosaicatura, miscelazione: "+command + newline);
                    frameP.setVisible(false); // SQUALLIDO! esci meglio!
                    barraP();
                    mettiMosaico();
          // ******** panel 2 : IMG RIFERIMENTO
          dico2 = new JTextArea(" Per impostare l'immagine di riferimento" newline " premere 'Imposta' e selezionare l'immagine "+newline,10,40);
          dico2.setEditable(false);
          dico2.setBorder(BorderFactory.createLineBorder(Color.black));//bordo
          JButton imposta = new JButton("Imposta");
          imposta.setBackground(bluex);
          imposta.addActionListener(new ActionListener(){ //quando premo ok ...
     public void actionPerformed(ActionEvent e){
                    String command = group.getSelection().getActionCommand();
                    imgRif();
          panelP1.add(dico3);
          panelP1.add(primo);
          panelP1.add(secondo);
          panelP1.add(terzo);
          panelP1.add(quarto);
          panelP1.add(quinto);
          panelP0.add(dico);
          panelP0.add(ok1);
          panelP2.add(dico2);
          panelP2.add(imposta);
          primo.addActionListener(this);
          secondo.addActionListener(this);
          JTabbedPane tabbedPane = new JTabbedPane(); //a schedario
          tabbedPane.setBackground(bluex);
          tabbedPane.addTab("Avvia Mosaicatura", null, panelP0, null);
          tabbedPane.addTab("Parametri", null, panelP1, null);
          tabbedPane.addTab("Img Riferimento", null, panelP2, null);
          tabbedPane.setSelectedIndex(0);
          panelP.add(tabbedPane);
          frameP.pack();
          frameP.setVisible(true);
// ========================================================================== super risoluzione
     if(source == superR){
          System.out.println("Super-risoluzione");
          final JFrame frameP = new JFrame("Parametri di Super-risoluzione");
          frameP.setSize(800,800);
          frameP.setBackground(bluex);
          JPanel panelP = new JPanel(new GridLayout(1,0));
          panelP.setBackground(bluex);
          panelP.setBorder(BorderFactory.createLineBorder(Color.black));
          panelP.setPreferredSize(new Dimension(500,500));
          frameP.getContentPane().add(panelP);
          JPanel panelP0 = new JPanel(new FlowLayout()); //avvia
          panelP0.setBackground(bluex);
          panelP0.setBorder(BorderFactory.createLineBorder(Color.black));
          panelP.add(panelP0);
          JPanel panelP1 = new JPanel(new FlowLayout());//parametri
          panelP1.setBackground(bluex);
          panelP1.setBorder(BorderFactory.createLineBorder(Color.black));
          panelP.add(panelP1);
          //**************** panel 1 : PARAMETRI
          JTextArea dico3 = new JTextArea(" Parametri di super-risoluzione",10,40);
          dico3.setEditable(false);
          dico3.setBorder(BorderFactory.createLineBorder(Color.black));//bordo
          JRadioButton primo = new JRadioButton("Nearest");
          primo.setActionCommand("nearest");
          primo.setSelected(true);
          primo.setBackground(bluex);
          JRadioButton secondo = new JRadioButton("Weighted");
          secondo.setActionCommand("weighted");
          secondo.setBackground(bluex);
          final ButtonGroup group = new ButtonGroup(); //raggruppo x fare esclusione
          group.add(primo);
          group.add(secondo);
          // ******** panel 0 : avvia
          JTextArea dico = new JTextArea(" Se si vuole avviare la super-risoluzione premere 'Avvia'" newline" in tal caso se non sono stati settati parametri verranno utilizzati quelli di default",10,40);
          dico.setEditable(false);
          dico.setBorder(BorderFactory.createLineBorder(Color.black));//bordo
          JButton ok1 = new JButton("Avvia");
          ok1.setBackground(bluex);
          ok1.addActionListener(new ActionListener(){ //quando premo ok ...
          public void actionPerformed(ActionEvent e){
                    String command = group.getSelection().getActionCommand();
               statusInfo.append(" Parametri super-risoluzione: "+command + newline);
                    frameP.setVisible(false); // SQUALLIDO! esci meglio!
                    barraP();
          panelP1.add(dico3);
          panelP1.add(primo);
          panelP1.add(secondo);
          panelP0.add(dico);
          panelP0.add(ok1);
          primo.addActionListener(this);
          secondo.addActionListener(this);
          JTabbedPane tabbedPane = new JTabbedPane(); //a schedario
          tabbedPane.setBackground(bluex);
          tabbedPane.addTab(" Avvia super-risoluzione", null, panelP0, null);
          tabbedPane.addTab(" Parametri", null, panelP1, null);
          tabbedPane.setSelectedIndex(0);
          panelP.add(tabbedPane);
          frameP.pack();
          frameP.setVisible(true);
          mettiMosaico();
// ===================================================== Mouse Event
public void mousePressed(MouseEvent e) {
     mousex = e.getX(); // Save the x coord of the click
mousey = e.getY(); // Save the y coord of the click
     for (int m=0; m<Nimg; m++){
          Point p = images[m].getLocation(); //posizione img[m] in panel
          px = (int)p.getX();
          py = (int)p.getY();
          if (mousex >= px && mousex <= (px+images[muovi].getWidth())
&& mousey >= py && mousey <= (py+images[muovi].getHeight())) {//se mouse dentro img
               _canDrag = true;
          _dragFromX = mousex-px;  // how far from left
          _dragFromY = mousey-py;  // how far from top
               muovi = m; //setto immagine da muovere!!!!
               if (rifno==0){panelpane.moveToFront(images[muovi]);}//davanti img ke muovo
               //se =1 nn mi muove img
     }//chiudo FOR
     if (rifno==1){
          statusInfo.append(" Immagine di riferimento: "+ muovi + newline);
          frameP.setVisible(true);
          dico2.append(" Immagine di riferimento impostata :"+muovi + newline);
          rifno=0;
public void mouseDragged(MouseEvent e) {
     if (_canDrag) {   // True only if button was pressed inside ball.
//--- Ball pos from mouse and original click displacement
int ballX = e.getX() - dragFromX;
int ballY = e.getY() - dragFromY;
     images[muovi].setLocation(_ballX,_ballY);
//--- Don't move the ball off the screen sides
ballX = Math.max(ballX, 0);
ballX = Math.min(ballX, panelpane.getWidth() - images[muovi].getWidth());
//--- Don't move the ball off top or bottom
ballY = Math.max(ballY, 0);
ballY = Math.min(ballY, panelpane.getHeight() - images[muovi].getHeight());
     Point p = images[muovi].getLocationOnScreen();
     int px = (int)p.getX();
     int py = (int)p.getY();
//panelpane.repaint(); // Repaint because position changed.
     public void mouseExited(MouseEvent e) {
     _canDrag = false;
     }//end mouseExited
public void mouseEntered (MouseEvent e) {} // ignore these events
public void mouseClicked (MouseEvent e) {
public void mouseReleased(MouseEvent e) {
          //e.consume();
} // ignore these events
public void mouseMoved(MouseEvent e) {}
}// chiude classe

please reuse the threads you've already started on this topic
http://forum.java.sun.com/thread.jspa?threadID=573384&tstart=50
and also, use the [url http://forum.java.sun.com/help.jspa?sec=formatting]formatting tags when posting code.
keep in mind, this is an awful lot of code, and few will have the time to read through all of it, so if at all possible, make a smaller example case for your problem when you can so that we don't have to try to sort through hundreds of lines of code to find what you want to do.

Similar Messages

  • SAVE POSITIONS OF THE COMPONENTS!!! HELP!!!

    HI!!!
    I don't understand!!!
    I insert images in JLayeredPane, I move this images, BUT when i press a button (invoke ActioListener) the images become in initial position!!!
    HELP ME!!!!!!!

    Don't clutter the forum by posting the [url
    http://forum.java.sun.com/thread.jspa?threadID=573772]
    same question three times.Why did you change your userid from this [url
    http://forum.java.sun.com/thread.jspa?threadID=573384]
    posting. If you are not the same person then
    you are both working on the same assignment and
    should get together to solve your problem.
    When I replied to the above posting I tried to
    explain what the problem was. If you didn't
    understand the explanation they ask a follow up
    question. Creating a new posting does not allow for
    continuity of the problem. New people reading this
    posting don't know what has already been suggested.
    Maybe myself or someone else will explain it better.
    I also asked you to:
    a) post a "small" example showing your problem. 200
    lines of code is not small.
    b) use the code tags when posting code. You couldn't
    even manage to do that.
    Have you read the code from the Swing tutorial on
    [url
    http://java.sun.com/docs/books/tutorial/uiswing/compon
    ents/layeredpane.html]Using Layered Panes for
    an example of this type of behaviour?
    A bit off topic but I have to say I truly admire your patience.

  • Help please! "Could not save as *** because the file...."

    I'm getting this error message when I try to save my files and it is happening often enough that it bothers me. This is very sudden - within the last week or two. I have Photoshop CS5, using Windows 7. I get the error message "Could not save as *** because the file is already in use or was left open by another application."
    I haven't done anything new to my computer or installed anything new, I've been using CS5 successfully since this summer when I first installed it on this brand new computer. Not sure why it's doing this now.
    When it happens, it does leave a .tmp file behind with each instance. I saved one this time just in case it's needed to determine the problem - normally I just delete it and try again. When I try multiple times, it eventually saves. But when I'm a professional photographer and have 100's of images to save, I just can't deal with this problem. Can anyone help? I'd be grateful!

    Are you saying you've disabled Spyware Doctor and it now works?  I'd toss that software out in a heartbeat if so.  Anti-malware software that interferes with your normal operation of your computer is not something to be accepted!
    Microsoft's Windows Defender is a decent substitute.  I also personally prefer Avast Pro antivirus.  Both are unobtrusive.
    -Noel

  • I am unable to install itunes. I get the pop-up asking if I want to save or cancel the iTunes64 file. I click save... and then nothing happens. Help!

    I am unable to install itunes. I get the pop-up asking if I want to save or cancel the iTunes64 file. I click save... and then nothing happens. Help!

    I'd first try downloading an installer from the Apple website using a different web browser:
    http://www.apple.com/quicktime/download/
    If you use Firefox instead of IE for the download (or vice versa), do you get a working installer?

  • How do you have the help file .chm hold its window position when the user resizes the help window.

    One of my customers is complaining that the help contents will scroll out of view when the window is resized.  Is there a way to anchor the position while the window is resized?

    My CHM is a help file for an application. The application uses F1 to open specific topics for help.  Therefore the help file needs to be visible but not cover the application to much. The Content in this situation is text however the help project contains Images, tables, text, etc. 
    If the user searches for the word "audio" in the search and it takes them to a section or sub topic that is half way down in the Topic, they would like that section or subtopic to stay in the same place as they resize the help window.  Using Bookmarks if the topic is large enough clicking the search link will place the results in the top left of the doc view window, however this is not necessarily the top of the topic. 
    Im not sure how else to explain what the user is seeing, sorry.
    Please explain "Also whether it remains consistent depends on whether an absolute or percentage value has been added to it."

  • MS office word (2011) will not save files on the hard disk. It will save on USB drives.  Help!

    I have installed MS Office 2011 on our iMac and Macbook Air.  The program works as expected on the Macbook Air.  However, on the iMac, neither Word nor Excel will save files to the internal hard drive.  Both save files to a USB memory stick.  The error message I receive is:
    This is not a valid file name.
    Try one or more of the following:
    * Chech the path to make sure it was typed correctly.
    * Select a file from the list of files or folders.
    I expect it is something with the file saving options, but haven't been able to sort it out.
    Help please.

    Found the answer with the help of Microsoft Office for Mac telephone support.....
    The name of the Mac Hard drive started with "\"
    Microsoft office can't cope with that.
    Renamed the hard drive without the back-slash and it works fine.

  • Hi! I was using Microsoft Word. And it said that there server was offline when I went to save it. The program  crashed, and  I have lost my report! Help!!!

    Hi! I was using Microsoft Word. And it said that the server was offline when I went to save it. The program  crashed, and  I have lost my report! Help!!!
    I was thinking there has to be a recovery file on the computer somewhere! Right?
    Help!

    Versions of Word on Windows make a backup file with the extension .abk, if that has been enabled in their options, I do not know whether the Mac versions do, or whether you enabled it but try using Spotlight to search for .abk or just abk.
    Where were you trying to save? a network server drive?

  • Photos in my from my iPhone have same numbering as photos from my dig camera.  They all go into iPhoto fine but when I backup to my ext hard drive it will only save one with the name IMG 1002 and I have two separate images both with that name.  Help?

    Photos in my from my iPhone have the same numbering as photos from my digital camera.  They all go into iPhoto fine but when I backup to my ext hard drive it will only save one with the name IMG 1002 and I have two separate images both with that name.  How do I get them all to save on my ext hard drive and hope do I prevent this numbering overlap in the future?  I'm really hoping I don't have to go through and manually rename every single picture.  Thanks.

    How are you backing up the photos?  The best way is to backup the library itself as that will preserve your organizational efforts as well as all metadata like keywords, titles, faces, places, books, etc.
    You can use a backup application that does incremental backups.  Thus only the first backup is a full one and subsequent backups just copy those files that are new or changed. I use Synk Pro.  The lower cost version, Synk, will do the same job.  Other similar apps can be found at MacUpdate.com.  
    OR: upload your camera to a folder on the Desktop. There you can rename the files to something that is more informative than just the file name.  I use the date (international format) along with a brief desc: 2007-1-20-adian1stbday-001.jpg.  File renaming apps can also be found at MacUpdate.com.  Also you can give the folder an informatve name which will become the Event name when you import the folder of photos into iPhoto.
    OT

  • HELP - how do you save pictures through the recovery mode?

    How do you save pictures through the recovery mode.  I have the black screen with cursor and despite trying all the tips noted here nothing seems to fix the issue.  These have included using Utility disk to re-install OS-X, repairing the disks.  Also tried the holding shift on start up and entering username and password.  Also tried internet recovery and then repair and re-install.  Nothing works!
    Happy to restore from a back up, but I have been rubbish and not backed up for a long time.  Also happy to delete and re-install completely but don't want to loose pics.
    Please let me know any suggestions!!

    bemsley wrote:
    Is it possible to attach an external drive and copy across files through the utility function?
    That requires that you can boot the MBP. 
    Or to boot the mac using the time machine back up?
    You can try using startup manager:
    http://support.apple.com/kb/ht1310
    But you still need a working volume where you can install the backed up data.
    The good news is that since you have a Time machine backup, you can transfer that data to another Mac or clone:
    http://pondini.org/OSX/Setup.html
    Ciao.

  • Save As- for the dummies

    Here is a clean way to retrieve Save As… feature in Pages
    --(SCRIPT Pages_save_a_copy]
    Enregistrer le script en tant que Script : Pages_save_a_copy.scpt
    déplacer le fichier créé dans le dossier
    <VolumeDeDémarrage>:Utilisateurs:<votreCompte>:Bibliothèque:Scripts:Applications :Pages:
    Il vous faudra peut-être créer le dossier Pages et peut-être même le dossier Applications.
    Aller au menu Scripts , choisir Pages puis choisir “Pages_save_a_copy”
    Le script enregistre une copie du document au premier plan
    au format natif de Pages en ajoutant la date et l'heure au nom du fichier.
    --=====
    L'aide du Finder explique:
    L'Utilitaire AppleScript permet d'activer le Menu des scripts :
    Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case "Afficher le menu des scripts dans la barre de menus".
    +++++++++
    Save the script as a Script: Pages_save_a_copy.scpt
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Pages:
    Maybe you would have to create the folder Pages and even the folder Applications by yourself.
    Go to the Scripts Menu, choose Pages, then choose “Pages_save_a_copy”
    The script saves the frontmost document
    in the native Pages format in a date_time stamped file.
    --=====
    The Finder's Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the "Show Script Menu in menu bar" checkbox
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2011/08/12
    on run
              local docPath, docName, docFolder, fileName, theExt, newName, newPath
              set major_OS to get system attribute "sysv"
    Grab infos about the open doc at front *)
              tell application "Pages"
                        tell document 1
                                  set docPath to its path
                                  set docName to its name
                        end tell
                        if major_OS ≥ 4208 then save docName (* Required for Lion *)
              end tell
    Grab infos about the file from which the doc was open *)
              tell application "System Events" to tell disk item docPath
                        set docFolder to path of container
                        set fileName to name
                        set theExt to name extension
              end tell
    Build an unique name for the new document *)
              if theExt is not "" then
                        set newName to (text 1 thru -(2 + (length of theExt)) of fileName) & (do shell script "date +_%Y%m%d_%H%M%S.") & theExt
              else
                        set newName to fileName & (do shell script "date +_%Y%m%d_%H%M%S")
              end if
    Create the new file *)
              tell application "System Events"
      make new file at end of folder docFolder with properties {name:newName}
              end tell
              set newPath to (docFolder & newName) as alias
    Save a copy in the newly created file *)
              tell application "Pages"
      save document docName in newPath
              end tell
    end run
    --=====
    --[/SCRIPT]
    --{code}
    Yvan KOENIG (VALLAURIS, France) vendredi 19 août 2011 22:15:39
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>

    Here is an other one.
    Read carefully the explanations given at the very beginning, in French then in English.
    With this one you master the time when you save. CAUTION, Autosave is unable to do it's duty when you work on a document open with the script so don't forget to ask the script to save from time to time.
    --(SCRIPT Pages_without_autosave]
    Enregistrer le script en tant qu'application sur le Bureau.
    Glisser une icône de document Pages sur l'icône de l’application
    ouvre le document, le duplique, ferme l'original renomme la copie en ajoutant l'information date_heure
    crée un bloc texte afin d'y stocker le chemin d'accès au dossier source et le nom court du document original.
    Travailler sur le document et de temps à autres, cliquer sur l'cône du script application afin d'enregistrer
    le document et repartir avec une copie qui n'ayant jamais été enregistré ne sera pas autoenregistré.
    Bien entendu, quand vous aurez fini de travailler sur le document il vous faudra l'enregistrer comme autrefois.
    --=====
    L'aide du Finder explique:
    L'Utilitaire AppleScript permet d'activer le Menu des scripts :
    Ouvrez l'Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case "Afficher le menu des scripts dans la barre de menus".
    +++++++++
    Save the script as an application on the Desktop.
    Drop a Pages doc icon on the application's one, open the document, duplicate it, save the original if it was created from a template,
    rename the duplicate inserting a date_time stamp, create a text box store the pathname to the source folder and the short name of the original.
    After that you may work upon the document. From time to time, click the script's icon to save the document
    and replace it by a fresh replicate. So this one which was never saved will not be autosaved.
    When you have finished to work upon the doc, save it as you did in the past.
    --=====
    The Finder's Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the "Show Script Menu in menu bar" checkbox
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2011/08/22
    property permitted : {"com.apple.iWork.Pages.pages", "com.apple.iWork.Pages.sffpages"}
    property modeles : {"com.apple.iWork.Pages.template", "com.apple.iWork.Pages.sfftemplate"}
    property boxName : "pathname_shortname_emantrohs_emanhtap"
    --=====
    on run
              local docName, path_infos, docFolder, nomCourt, docPath, nbd
              my controle_versions()
    Grab infos about the frontmost Pages document *)
              tell application "Pages"
                        set docName to name of document 1
                        tell document docName
    Try to extract the infos stored by the open handler          *)
                                  try
                                            set path_infos to object text of text box boxName
                                  on error
                                            if my parleAnglais() then
                                                      error "The document “" & docName & "”" & return & "wasn’t open with this script !"
                                            else
                                                      error "Le document « " & docName & " »" & return & "n’a pas été ouvert avec ce script !"
                                            end if
                                  end try
                        end tell -- document
              end tell -- Pages
    Split the extracted datas *)
              set {docFolder, nomCourt} to my decoupe(path_infos, tab)
              set docPath to docFolder & docName
              tell application "System Events"
    This test was useful during my tests, now it's useless *)
                        if not (exists disk item docPath) then
      make new file at end of folder docFolder with properties {name:docName}
                        end if
              end tell -- System Events
              set docPath to docPath as alias
    I don't understand why I must apply save - close - open          but without that it fails *)
              tell application "Pages"
      save document docName in docPath
      close document docName
      open docPath
                        set nbd to count of documents
              end tell
              my selectMenu("Pages", 3, 10) (* Duplicate *)
    Wait the availability of the duplicate *)
              tell application "Pages"
                        repeat 100 times
                                  if (get count of documents) > nbd then exit repeat
                                  delay 0.2
                        end repeat
    Now we may close the 'old' document *)
      close document docName without saving
              end tell -- Pages
    Build a date_time stamped name for next version *)
              set docName to nomCourt & my build_a_stamp() & ".pages"
              tell application "Pages"
                        set name of document 1 to docName
              end tell
    end run
    --=====
    on open (sel)
              local docPath, docFolder, fileName, theExt, typeID, nomCourt, nouveauNomCourt, newPath, oldUnits, docName, nbd
    Apply consistency checks *)
              my controle_versions()
              set docPath to sel's item 1 (* Here, docPath is an alias *)
    Extract some infos about the original document *)
              tell application "System Events" to tell disk item (docPath as text)
                        set docFolder to path of container
                        set fileName to name
    The try block may be useful if an user is fool enough to drag & drop a folder on the scrip’s icon *)
                        try
                                  set theExt to name extension
                        on error
                                  set theExt to ""
                        end try
                        try
                                  set typeID to type identifier
                        on error
                                  set typeID to ""
                        end try
              end tell
    Check that the dragged item is a Pages document *)
              if (typeID is not in permitted) and (typeID is not in modeles) then error number -128
    Strip the name extension if there is one *)
              if theExt is not "" then
                        set nomCourt to (text 1 thru -(2 + (length of theExt)) of fileName)
              else
                        set nomCourt to fileName
              end if
    If the original is a template, we will save the newly created file *)
              if typeID is in modeles then
                        set nouveauNomCourt to nomCourt & my build_a_stamp()
                        set fileName to nouveauNomCourt & ".pages"
    Create a new file *)
                        tell application "System Events"
      make new file at end of folder docFolder with properties {name:fileName}
                        end tell
                        set newPath to (docFolder & fileName) as alias
              end if
              tell application "Pages"
                        set oldUnits to ruler units
                        set ruler units to points
      open docPath
                        if typeID is in modeles then
    Original is a template so save the new doc once *)
      save document 1 in newPath
                                  set name of document 1 to fileName
                        end if
                        set docName to name of document 1
                        set nbd to count of documents
              end tell
              my selectMenu("Pages", 3, 10) (* Duplicate *)
    Wait the availability of the duplicate *)
              tell application "Pages"
                        repeat 100 times
                                  if (get count of documents) > nbd then exit repeat
                                  delay 0.2
                        end repeat
    Now may close the 'original' document *)
      close document docName without saving
              end tell
              set docName to nomCourt & my build_a_stamp() & ".pages"
              tell application "Pages"
                        set name of document 1 to docName
    CAUTION : due to a bug, whichever wrap property is asked, the object is defined with wrap = center *)
                        tell document docName
      make text box at front with properties {widthget width of page 1), name:boxName, object text:docFolder & tab & nomCourt, horizontal position:0.0, vertical position:0.0, height:15.0, placement:fixed, wrap:none}
                                  tell text box boxName to set properties of object text to {color:{65535, 65535, 65535}, font size:9.0, font name:"Helvetica"}
                        end tell -- document
                        set ruler units to oldUnits
              end tell
    end open
    {width:358.0,
    name:missing value,
    stroke type:none,
    object text:"Tapez pour saisir le texte",
    rotation:0.0,
    stroke width:missing value,
    locked:0,
    text fit:rectangle,
    end color:missing value,
    extra space:12.0,
    horizontal position:5.0,
    class:text box,
    id:5459273,
    color angle:missing value,
    shadow blur:missing value,
    stroke color:missing value,
    vertical position:5.0,
    height:20.0,
    shadow opacity:missing value,
    shadow color:missing value,
    placement:fixed,
    wrap:center,
    fill type:none,
    containing page:…
    shadow angle:missing value,
    image data:missing value,
    containing layer:foreground layer of page 1 of document id 1648067 of application "Pages",
    single color:missing value,
    shadow:missing value,
    image fill type:missing value,
    shadow offset:missing value,
    start color:missing value,
    opacity:100.0}
    --=====
    on build_a_stamp()
              return do shell script "date +_%Y%m%d_%H%M%S"
    end build_a_stamp
    --=====
    on controle_versions()
              local app_Version, sysv
              tell application "Pages" to set app_Version to version
              set sysv to system attribute "sysv"
              if (app_Version < "4.1") or (sysv < 4208) then error number -128
    end controle_versions
    --=====
    on parleAnglais()
              local z
              try
                        tell application "Pages" to set z to localized string "Cancel"
              on error
                        set z to "Cancel"
              end try
              return (z is not "Annuler")
    end parleAnglais
    --=====
    on decoupe(t, d)
              local oTIDs, l
              set oTIDs to AppleScript's text item delimiters
              set AppleScript's text item delimiters to d
              set l to text items of t
              set AppleScript's text item delimiters to oTIDs
              return l
    end decoupe
    --=====
    on recolle(l, d)
              local oTIDs, t
              set oTIDs to AppleScript's text item delimiters
              set AppleScript's text item delimiters to d
              set t to l as text
              set AppleScript's text item delimiters to oTIDs
              return t
    end recolle
    --=====
    my selectMenu("Pages",5, 12)
    ==== Uses GUIscripting ====
    on selectMenu(theApp, mt, mi)
              tell application theApp to activate
              tell application "System Events" to tell process theApp to tell menu bar 1 to tell menu bar item mt to tell menu 1 to click menu item mi
    end selectMenu
    --=====
    --[/SCRIPT]
    --{code}
    Yvan KOENIG (VALLAURIS, France) mardi 23 août 2011 11:24:09
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • How do I take movies and save them on the iPad?

    How do I take movies and save them on the iPad?
    Thank you for your help.

    Tank you Jim for responding: "(swipe Video to the selected position - don't just touch it)."
    (I can't believe this!) I open camera. tap video: nothing. Swipe video button (where to?) nothing.
    Reading videos at a glance in the iPad user guide gives me nothing. I know I must be missing something. 
    Thank you for your help.
                                             Walter                                                                                       

  • Subcontracting PO - Batch number to be made mandatory for the components

    Hi All,
    I have a situation in Subcontracting PO. The components which are sent to vendor need to be updated with Batch number. Is there any User Exit  / Configuration available, which can provide a error message to the user when ever he tries to save the PO without the batch number entered for the components.
    SAP allows to save the SC-PO, if the batch numbers are not entered for the components which are batch managed. I have checked the PO Fields in Customizing, which has control of the Batch number for the header material in the material data tab & not for the components which will be available after the BOM icon is clicked.
    Appreciate if you experts provide a solution / work around for the above scenario, as the client is a pharma client & they need to exactly match the batch which has been sent out for making Finished product with the Sub contracting vendor.
    Thanks for your help & awaiting your reply at the earliest.
    Regards,
    Sathya Padmanabhan

    Hi,
    you shoudl definitively check out SAP best Practices for Pharmaceuticals, which can be foubnd in the helpportal:
    http://help.sap.com/bp_pharmav1600/Pharma_US/index.htm
    Go to the Business Information area....there are some subcontracting scenarios....
    Oliver

  • Positioning of GUI components

    a question for the java veterans out there,
    i am a student of programming and i wish to learn how to place/position GUI components in java by hard coding it. Is there any trick/technique that this could be done easily? I don't want to rely on netbeans's GUI maker to make my programs's GUI for the rest of my life.
    any help is appreciated.
    (please don't make it quite complicated. ^_^)

    Hi,
    The link to the tutorial you requested is [Laying out Components within a Container|http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html], more specific [Doing Without a Layout Manager (Absolute Positioning)|http://java.sun.com/docs/books/tutorial/uiswing/layout/none.html]. But I would suggest you start to learn using the default layout managers first before you venture out into the wild lands named 'absolute positioning'. The layout mangers supplied by Sun (and made by a big bunch of seasoned Sun Java Programmers) help you when something happens in your screen, like resizing the window. If you use absolute positioning you have to handle such cases yourself.
    Abel

  • Could use some help on positioning images

    With help here, I'm making my way through ID novice to ID "dangerous". I sorta get layout and sorta get styling and now could use some help with sizing and positioning images.
    The test is a 3-column newspaper that I let ID size when the document was created. All the text frames are linked. I now want to put some images on the pages and have the text wrap. I sorta understand wrapping and anchoring, the question is sizing.
    Am I on the right path to start thinking that images often need to be sized to a column width or two (plus gutter)? If so, do I size images based on the frame size? For example, the columns show as 3.2222in and the gutter as .1667. Does that mean I want to set the image width to 3.2887 or are things just not that accurate? What are the best practices?
    One related question on wrapping: it seems like anchoring the image allows wrapping around only one frame of text but not the other if the image spans two text columns. How do you place and image so that it wraps text in more than one column?
    Also, do people make the image smaller than the frame to put a border in when wrapping text?
    Thanks
    Tom

    Are you asking about image size as it is saved, or as placed on the page?
    With older RIPS it was common to want to save images at the correct dimensions so when placed at 100% they would have the correct resolution. This was to reduce processing time. Today that is less of an issue and it is not at all unusual to scale images in the InDesign layout. (I'm talking raster here -- vector objects can be scaled almost infinitely.)
    So, what is the correct size? There are a number of rules of thumb, but the basic one is that images should be placed so that the resolution, at the size they will be printed, is twice the value of the linescreen being used. Anything in the range of 1.5 to 2.5 is probably acceptable, and I know people who routinely send images at 1.4 times the linescreen.
    For coated papers and reasonably good reproduction, 150 lpi is not unusual, with 200 lpi for fine art books, so you get the common suggestion that images should be 300 ppi. Newspaper printing is usually accomplished on fairly porous stock at much lower screen frequencies -- 80 to 100 lpi -- so you need considerably less image resolution.
    How do you know what the resolution is at the size you've place the image? Look at the info panel with an image selected. You'll see too numbers, an "actual" ppi and an "effective" ppi. The actual number is simply the resolution recorded with the image at its dimensions when it was saved (and digital cameras often save images 20 inches or so wide at 72 ppi) and is basically irrelevant. The effective ppi is the one that matters. If it's too small, either reduce the size of the image on the page, or be prepared to live with less than stellar reproduction. If it's grossly over the requirement it usually won't hurt except for some increased processing time, but the extra image data won't improve things as it gets discarded by the RIP.
    It's usually OK to downsample an image in Photoshop, though you will sometimes lose fine detail or subtlety in shading, but you'd probably lose the same things through scaling in ID. Upsampling never helps.
    I presume you know that you can place graphical objects in several ways, either into an existing frame, at full size (whatever that happens to be and at the "actual" resolution) by clicking the loaded cursor on an empty spot on the page, or you can click and drag a new frame the size you want. When an image is first placed it will always be "actual size" unless some scaling factor has been applied to the frame in advance, so you may not see the entire image. You then have several fitting options available to either make the frame fit the image or the image fit the frame (and in newspaper work you pretty much only want to fit to or fill the frame proportionally).
    I personally like keeping the images snapped to the column grid, but it's by no means an iron-clad rule. You want to avoid situations, though, where an image impinges on a column to the point that the remaining text is unworkably narrow.
    I don't know why you are using anchored frames for your images (text wrap only affects text in the frame after the anchor point). It's not likely in a newspaper that you would want the pictures to move on the page if you edit the text. You can group the image, caption and story, if you like, so that they all stay together if you need to re-arrange the page or move them to a new location.
    I don't know if I answered your question. Feel free to come back for clarification.
    Peter

  • Save position of right hand as "home"-position

    When the Kinect has tracked my right hand (JointType.HandRight), I want it to save the current position of the hand as a "home"-position which later can be referred to when for example my right hand moves to the right from the "home"-position.
    I'm a novice in programming and would highly appreciate code for show and an explanation (and note if there's anything in the existing code that's wrong or missing)! Thanks!
    // Find the right hand joint
    IList<Microsoft.Kinect.Body> bodies;
    void Reader_MultiSourceFrameArrived(object sender, MultiSourceFrameArrivedEventArgs e)
    var reference = e.FrameReference.AcquireFrame();
    using (var frame = reference.BodyFrameReference.AcquireFrame())
    if (frame != null)
    bodies = new Microsoft.Kinect.Body[frame.BodyFrameSource.BodyCount];
    frame.GetAndRefreshBodyData(bodies);
    foreach (var body in bodies)
    if (body != null)
    if (body.IsTracked)
    // Find the joint
    Joint handRight = body.Joints[Microsoft.Kinect.JointType.HandRight];
    // Around here maybe having the code which saves the current position as "home"

    I could make an IF code line where if I close my hand, the kinect will respond to that action as saving that position as "home" and while I have my hand closed the robot will respond when I move my hand from that positioned home. How do I perform
    what you said in the following: "Then you could compute for each body frame, what is the position vector from the home point and make your robot move depending on than vector"? I suppose you'r talking about making the work space in x, y, z work as
    the robot will perform the same movement as my hand? I'm right now a little of a novice in programming as I've gotten a little rusty while I haven't programmed that much during the years. I've checked the Kinect v2 documentation but I don't know what information
    nor code I could use.
    I have watched the jump start videos and they gave me a better understanding in the kinect but didn'tfeel that
    they were helpful for the coding and
    for my specific work, but I could be wrong.
    Once again I've haven't got a good understanding of the differences yet so if you say body frame is enough
    you'r probably right, could you tell me the differences?
    And do I change
    thus only the multisource for the body frame in the code?
    Thank you for the help and sorry for my late response!

Maybe you are looking for

  • Java Program with Adapter / Facade Pattern

    Hey All: I'm very new to the Java language and have been given a fairly complicated (to me) program to do for a course I'm taking. The following is the scenario. I'll post code examples I have and any help will be greatly appreciated. Let me apologiz

  • How do I get pdf file to open from websites?

    When I click on a pdf file to open from a website, Explorer tries to open the pdf, but reloads the page then errors out.  I am running XP pro with the Adobe Reader X.  I have tried to uninstall reader and re-install.  My registry is using the correct

  • Pack and unpack in ABAP objects

    can anyone explain me how to pack or unpack a field inside a method which is inside a class.

  • "Save to Adobe PDF" missing in Mac print dialog

    I've just upgraded to a new machine, and the "Save to Adobe PDF" option is missing from the PDF drop-down menu in the print dialogue.  I'm running Mac OS 10.8.3 and CS 6.  I believe that Acrobat X is supposed to automatically install this option into

  • How to fetch message comments using JMA API?

    Hi All, From telnet <host> 143, and tring get comments associated with a message works well as shown below. 2 fetch 8 COMMENT ("/message/vendor/ms/follow-up-flag-status" ("value.shared")) * 8 FETCH (COMMENT ("/message/vendor/ms/follow-up-flag-status"