Help? How to dispose frame from JList Command

To every one out there,
i design an application with a menu using Jlist, when i selected a element from the list, it bring me to the next frame,however this frame with the JList that i want to dispose is still there.
I have try this.dispose();
this.show(false);
this.hide();
and it give a compliation error or unable to run or not function as i expected.
i call the frame using
Frame1 obj = new Frame();
obj.show(true);

Here is my codes
String[] select={"Register new Disc","Delete disc","Edit disc",
"Set Rental Price and duration","View and Print",
"Rental Limit for members","Password"};
jList1=new JList(select);
MouseListener mouseListener = new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {
int index = jList1.locationToIndex(e.getPoint());
if(index==0){
Frame2 obj = new Frame2();
obj.setSize(600,600);
obj.show(true);
if(index==1){
Delete obj=new Delete();
obj.setSize(600,600);
obj.show(true);
if(index==5){
Rental obj=new Rental();
obj.setSize(600,600);
obj.show(true);
if(index==6){
login obj=new login();
obj.setSize(600,600);
obj.show(true);
jList1.addMouseListener(mouseListener);

Similar Messages

  • How call a frame from a Servelt please

    how call a frame from a Servelt please

    hi, you can output a javascript that calls a frame as follows
    PrintWriter out=response.getWriter();
    out.print("<script>");
    out.print("window.frames['frameName'].functionCall();");
    out.print("</script>");
    good luck

  • How to stop frame from closing?

    Hi,
    ramka.addWindowListener(new WindowAdapter()
                  public void windowClosing(WindowEvent e)
                      Object [] qqq = {"yes", "no"};
                      int answer = JOptionPane.showOptionDialog(
                                null,
                                 "want to close window?",
                                 JOptionPane.YES_NO_OPTION,
                                  JOptionPane.QUESTION_MESSAGE,
                                  null,
                                 qqq,
                                 qqq[1]);
                      if (answer == JOptionPane.YES_OPTION)
                           // WHAT TO DO TO STOP WINDOW FROM CLOSING?
                  });as you can see above i want to stop frame from closing.
    what should i do in the commented line?
    or maybe somewhere else?
    please help,
    thanks

    Hello friend,
    I've found a solution for your query. I think, you'll get a solution from my codings. I've given you below my codings,plz go through it.Verify it. Reply me about my codings.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.JOptionPane;
    public class MyFrame extends JFrame{
         JButton jb=new JButton("My Details");
         public MyFrame(){
         JPanel jp=new JPanel();
         jp.add(jb,new FlowLayout(FlowLayout.CENTER));
         add(jp);
         jb.addActionListener(new ActionListener(){
         public void actionPerformed(ActionEvent ae){
                   if(ae.getSource()==jb){
                        String str[]={
                             "Name : Karthikeyan.K",
                             "Email-ID : [email protected]"
                        JOptionPane.showMessageDialog(null, str);
    WindowCloser wc=new WindowCloser();
    addWindowListener(wc);
         class WindowCloser extends WindowAdapter{
              public void windowClosing(WindowEvent we){
                   int res=JOptionPane.showConfirmDialog(null,"Do you want to exit from it?","Confirmation!!!",JOptionPane.YES_NO_CANCEL_OPTION,JOptionPane.QUESTION_MESSAGE);
                   switch(res){
                        case JOptionPane.YES_OPTION:
                             dispose();
                             System.exit(0);
                             break;
                        case JOptionPane.NO_OPTION:
                             repaint();
                             doOpenFrame();
                             break;
                        case JOptionPane.CANCEL_OPTION:
                             repaint();
                             doOpenFrame();
                             break;
                        case JOptionPane.CLOSED_OPTION:
                             repaint();
                             doOpenFrame();
                             break;
         public static void doOpenFrame(){
              MyFrame mf=new MyFrame();
              mf.pack();
              mf.setSize(400,400);
              mf.setVisible(true);
         public static void main(String ar[]){
         doOpenFrame();
    }

  • This is how you extract frames from video

    right then, in answer to many posts about how to get the individual frames from video, here is my solution. it seems to work with mpg files but it doesnt seem to work with any of the avi files i tried. not sure why it doesnt work with those. i have modified javas frame access.
    nothing is displayed except it prints which frame it is doing.
    if anyone wants to improve it, please do. i still dont understand fully how it works so i probably wont be able to answer many questions about it. anyway here it is:
    * @(#)FrameAccess.java 1.5 01/03/13
    * Copyright (c) 1999-2001 Sun Microsystems, Inc. All Rights Reserved.
    * Sun grants you ("Licensee") a non-exclusive, royalty free, license to use,
    * modify and redistribute this software in source and binary code form,
    * provided that i) this copyright notice and license appear on all copies of
    * the software; and ii) Licensee does not utilize the software in a manner
    * which is disparaging to Sun.
    * This software is provided "AS IS," without a warranty of any kind. ALL
    * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY
    * IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
    * NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE
    * LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING
    * OR DISTRIBUTING THE SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS
    * LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT,
    * INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
    * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF THE USE OF
    * OR INABILITY TO USE SOFTWARE, EVEN IF SUN HAS BEEN ADVISED OF THE
    * POSSIBILITY OF SUCH DAMAGES.
    * This software is not designed or intended for use in on-line control of
    * aircraft, air traffic, aircraft navigation or aircraft communications; or in
    * the design, construction, operation or maintenance of any nuclear
    * facility. Licensee represents and warrants that it will not use or
    * redistribute the Software for such purposes.
    import java.awt.*;
    import javax.media.*;
    import javax.media.control.TrackControl;
    import javax.media.Format;
    import javax.media.format.*;
    import java.io.*;
    import javax.imageio.*;
    import javax.imageio.stream.*;
    import java.awt.image.*;
    import java.util.*;
    import javax.media.util.*;
    * Sample program to access individual video frames by using a
    * "pass-thru" codec. The codec is inserted into the data flow
    * path. As data pass through this codec, a callback is invoked
    * for each frame of video data.
    public class FrameAccess implements ControllerListener {
         Processor p;
         Object waitSync = new Object();
         boolean stateTransitionOK = true;
         public boolean alreadyPrnt = false;
         * Given a media locator, create a processor and use that processor
         * as a player to playback the media.
         * During the processor's Configured state, two "pass-thru" codecs,
         * PreAccessCodec and PostAccessCodec, are set on the video track.
         * These codecs are used to get access to individual video frames
         * of the media.
         * Much of the code is just standard code to present media in JMF.
         public boolean open(MediaLocator ml) {
              try {
                   p = Manager.createProcessor(ml);
              } catch (Exception e) {
                   System.err.println(
                        "Failed to create a processor from the given url: " + e);
                   return false;
              p.addControllerListener(this);
              // Put the Processor into configured state.
              p.configure();
              if (!waitForState(Processor.Configured)) {
                   System.err.println("Failed to configure the processor.");
                   return false;
              // So I can use it as a player.
              p.setContentDescriptor(null);
              // Obtain the track controls.
              TrackControl tc[] = p.getTrackControls();
              if (tc == null) {
                   System.err.println(
                        "Failed to obtain track controls from the processor.");
                   return false;
              // Search for the track control for the video track.
              TrackControl videoTrack = null;
              for (int i = 0; i < tc.length; i++) {
                   if (tc.getFormat() instanceof VideoFormat) videoTrack = tc[i];
                   else     tc[i].setEnabled(false);
              if (videoTrack == null) {
                   System.err.println("The input media does not contain a video track.");
                   return false;
              String videoFormat = videoTrack.getFormat().toString();
              Dimension videoSize = parseVideoSize(videoFormat);
              System.err.println("Video format: " + videoFormat);
              // Instantiate and set the frame access codec to the data flow path.
              try {
                   Codec codec[] = { new PostAccessCodec(videoSize)};
                   videoTrack.setCodecChain(codec);
              } catch (UnsupportedPlugInException e) {
                   System.err.println("The process does not support effects.");
              // Realize the processor.
              p.prefetch();
              if (!waitForState(Processor.Prefetched)) {
                   System.err.println("Failed to realise the processor.");
                   return false;
              p.start();
              return true;
         /**parse the size of the video from the string videoformat*/
         public Dimension parseVideoSize(String videoSize){
              int x=300, y=200;
              StringTokenizer strtok = new StringTokenizer(videoSize, ", ");
              strtok.nextToken();
              String size = strtok.nextToken();
              StringTokenizer sizeStrtok = new StringTokenizer(size, "x");
              try{
                   x = Integer.parseInt(sizeStrtok.nextToken());
                   y = Integer.parseInt(sizeStrtok.nextToken());
              } catch (NumberFormatException e){
                   System.out.println("unable to find video size, assuming default of 300x200");
              System.out.println("Image width = " + String.valueOf(x) +"\nImage height = "+ String.valueOf(y));
              return new Dimension(x, y);
         * Block until the processor has transitioned to the given state.
         * Return false if the transition failed.
         boolean waitForState(int state) {
              synchronized (waitSync) {
                   try {
                        while (p.getState() != state && stateTransitionOK)
                             waitSync.wait();
                   } catch (Exception e) {
              return stateTransitionOK;
         * Controller Listener.
         public void controllerUpdate(ControllerEvent evt) {
              if (evt instanceof ConfigureCompleteEvent
                   || evt instanceof RealizeCompleteEvent
                   || evt instanceof PrefetchCompleteEvent) {
                   synchronized (waitSync) {
                        stateTransitionOK = true;
                        waitSync.notifyAll();
              } else if (evt instanceof ResourceUnavailableEvent) {
                   synchronized (waitSync) {
                        stateTransitionOK = false;
                        waitSync.notifyAll();
              } else if (evt instanceof EndOfMediaEvent) {
                   p.close();
                   System.exit(0);
         * Main program
         public static void main(String[] args) {
              if (args.length == 0) {
                   prUsage();
                   System.exit(0);
              String url = args[0];
              if (url.indexOf(":") < 0) {
                   prUsage();
                   System.exit(0);
              MediaLocator ml;
              if ((ml = new MediaLocator(url)) == null) {
                   System.err.println("Cannot build media locator from: " + url);
                   System.exit(0);
              FrameAccess fa = new FrameAccess();
              if (!fa.open(ml))
                   System.exit(0);
         static void prUsage() {
              System.err.println("Usage: java FrameAccess <url>");
         * Inner class.
         * A pass-through codec to access to individual frames.
         public class PreAccessCodec implements Codec {
              * Callback to access individual video frames.
              void accessFrame(Buffer frame) {
                   // For demo, we'll just print out the frame #, time &
                   // data length.
                   long t = (long) (frame.getTimeStamp() / 10000000f);
                   System.err.println(
                        "Pre: frame #: "
                             + frame.getSequenceNumber()
                             + ", time: "
                             + ((float) t) / 100f
                             + ", len: "
                             + frame.getLength());
              * The code for a pass through codec.
              // We'll advertize as supporting all video formats.
              protected Format supportedIns[] = new Format[] { new VideoFormat(null)};
              // We'll advertize as supporting all video formats.
              protected Format supportedOuts[] = new Format[] { new VideoFormat(null)};
              Format input = null, output = null;
              public String getName() {
                   return "Pre-Access Codec";
              //these dont do anything
              public void open() {}
              public void close() {}
              public void reset() {}
              public Format[] getSupportedInputFormats() {
                   return supportedIns;
              public Format[] getSupportedOutputFormats(Format in) {
                   if (in == null)
                        return supportedOuts;
                   else {
                        // If an input format is given, we use that input format
                        // as the output since we are not modifying the bit stream
                        // at all.
                        Format outs[] = new Format[1];
                        outs[0] = in;
                        return outs;
              public Format setInputFormat(Format format) {
                   input = format;
                   return input;
              public Format setOutputFormat(Format format) {
                   output = format;
                   return output;
              public int process(Buffer in, Buffer out) {
                   // This is the "Callback" to access individual frames.
                   accessFrame(in);
                   // Swap the data between the input & output.
                   Object data = in.getData();
                   in.setData(out.getData());
                   out.setData(data);
                   // Copy the input attributes to the output
                   out.setFlags(Buffer.FLAG_NO_SYNC);
                   out.setFormat(in.getFormat());
                   out.setLength(in.getLength());
                   out.setOffset(in.getOffset());
                   return BUFFER_PROCESSED_OK;
              public Object[] getControls() {
                   return new Object[0];
              public Object getControl(String type) {
                   return null;
         public class PostAccessCodec extends PreAccessCodec {
              // We'll advertize as supporting all video formats.
              public PostAccessCodec(Dimension size) {
                   supportedIns = new Format[] { new RGBFormat()};
                   this.size = size;
              * Callback to access individual video frames.
              void accessFrame(Buffer frame) {
                   // For demo, we'll just print out the frame #, time &
                   // data length.
                   if (!alreadyPrnt) {
                        BufferToImage stopBuffer = new BufferToImage((VideoFormat) frame.getFormat());
                        Image stopImage = stopBuffer.createImage(frame);
                        try {
                             BufferedImage outImage = new BufferedImage(size.width, size.height, BufferedImage.TYPE_INT_RGB);
                             Graphics og = outImage.getGraphics();
                             og.drawImage(stopImage, 0, 0, size.width, size.height, null);
                             //prepareImage(outImage,rheight,rheight, null);
                             Iterator writers = ImageIO.getImageWritersByFormatName("jpg");
                             ImageWriter writer = (ImageWriter) writers.next();
                             //Once an ImageWriter has been obtained, its destination must be set to an ImageOutputStream:
                             File f = new File(frame.getSequenceNumber() + ".jpg");
                             ImageOutputStream ios = ImageIO.createImageOutputStream(f);
                             writer.setOutput(ios);
                             //Finally, the image may be written to the output stream:
                             //BufferedImage bi;
                             //writer.write(imagebi);
                             writer.write(outImage);
                             ios.close();
                        } catch (IOException e) {
                             System.out.println("Error :" + e);
                   //alreadyPrnt = true;
                   long t = (long) (frame.getTimeStamp() / 10000000f);
                   System.err.println(
                        "Post: frame #: "
                             + frame.getSequenceNumber()
                             + ", time: "
                             + ((float) t) / 100f
                             + ", len: "
                             + frame.getLength());
              public String getName() {
                   return "Post-Access Codec";
              private Dimension size;

    The quality of the produced video from this example is very poor.
    It comes to huuuuge surprise the following fact.
    If you comment the line where you set the PostAccessCodec, the chain of the codecs is:
    MPEG-1 decoder -> YUV2RGB -> Direct Draw Renderer. ( The one used from the system to decode and render)
    If you run the example purely as is above you get the following sequence(as long with the poor quality):
    MPEG-1 decoder -> YUV2RGB -> Windows GDI Renderer.
    So you say lets set another Renderer. So
    you add the following line videoTracker.setRenderer( new DDRenderer() )
    What comes to a surprise is the following chain of codecs:
    MPEG-1 decoder -> YUV2RGB -> Post Codec -> Java RGB Converter - > DDRenderer
    The quality now may be perfect but video runs to slow. The surprising thing here is that even though we have set the outputFormat of the PostAccessFrame codec to RGBFormat the system converts it again to RGB through codec Java RGB Format.
    After searching a lot and reaching the conclusion that the deference between the 2 RGB's is their sizes I sudently was brought in front of a method called grabFrame(). Bels started ringing inside my head. Starts were comming up. Looking at the definition of the class com.sun.media.renderer.video.DDRenderer I descovered that this damn class implements the FrameGrabbingControl Interface. What the f.....? The problem that consumed 4 days of my life and multiplied with 10 to give hours has finally come to an and.
    Summing up the solution for grabbing frames is this!!!!!
    DDRenderer renderer = new DDRenderer();
    videoTrack.setRenderer( renderer );
    and in your actionPerformed implementation
    FrameGrabbingControl fr = (FrameGrabbingControl)renderer.getControl( "javax.media.control.FrameGrabbingControl");
    Buffer frame = fr.grabFrame();
    The following stuff ...are stated in FrameAccess
    --Sniper

  • Help, How Do I Switch From English To Chinese?

    How do I go from English typing to Chinese typing and vice versa? Much thanks.

    Go to system prefs/international/input menu and check the boxes for the kinds of Input Method you wish to use, plus the box for Show Input Menu in Finder. Then select your IM in the "flag" menu at the top right of the Finder and type. Hit the space bar to see hanzi if necessary. For full info you can use the Help provided with OS X and this site:
    http://www.yale.edu/chinesemac/

  • How to stop frame from closing in windowClosing event ?

    I have an application which will download some files from the web.
    If the user attempts to close the applicaiton and if some files donwload action is in progress then i need to warn the user and prevent the window from closing. This is what i have done. But what happens is message box is displayed and my window is getting closed. How to get rid of this ? need your help...
    frame.addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent we) {
                        if(DownloaderGUI.tableModel.isSomeThingDownloading()) {
                             JOptionPane.showMessageDialog(null,"cannot close when something is downloading");
                             return;
                        System.out.print("closing..");
                        backEndThread.setCanQuit(true);
                        cleanUp();
                        System.exit(0);
              });

    I have also done a similar things but still window is getting closed.
    public void actionPerformed(...)
    if(!canquit) {
          return;
    } else {
          System.exit(0);
    }Message was edited by:
    chaos_begins_here

  • Disposing frame from other class

    Hello,
    I have a problem closing another frame by pressing the button in a frame.
    I have this method in the frame I want closed
      public void closeWindow()
            dispose();
            System.out.println("==========================");
        }And I call the method using this piece of code
        public class btnOkHandler implements ActionListener
          public void actionPerformed (ActionEvent e)
              //deleteUser();
              dispose();
              ftest = new frmTest();
              ftest.closeWindow();
        }So the btnOkHandler class should dispose both the frame where the button is in (wich it already does) and it should dispose the frame frmTest wich it won?t do.
    I guess it won?t dispose it because it opens the frame with this piece of code :
    ftest = new frmTest();But I can?t seem to find a work around of how to call the method with dispose(); in it from frmTest.

    Late reaction I know, but I still havent figured it out.
    I will post a sample code of what I mean.
    I will post a code for frame1 and frame2.
    A button in frame1 opens frame2, and a button in frame 2 should close frame1.
    I have commented out what doesn't work. Well actually it does work but it doesn't work how I want it.
    I figure it bugs because I make an instance to frame1, and it disposes it. So basically I have:
    Frame1 open
    Frame2 open
    Instances frame1
    Another frame1 open
    Closes frame1, still leaving 1 frame1 open.
    Could anybody suggest how I could get rid of the instance new Frame1 but still being able to dispose that frame?
    import java.awt.*;
    import java.awt.event.*;
    public class Frame1 extends Frame
         private Button btnOpen;
          public static void main (String[] args)
                 new Frame1();
         public Frame1()
              createUI();
         /*public void close()
              setVisible(false);
              dispose();
         private class OpenHandler implements ActionListener
              public void actionPerformed (ActionEvent e)
                   Frame2 f2 = new Frame2();
                   f2.openWindow();
         public void createUI()
              setSize (350,350);
              setTitle ("Screen1");
             setVisible (true);
             setResizable (false);
              Button btnOpen = new Button("Open frame");
              btnOpen.addActionListener (new OpenHandler() );
              add (btnOpen);
    import java.awt.Button;
    import java.awt.Frame;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    public class Frame2 extends Frame
         private Button btnClose;
          public static void main (String[] args)
                 new Frame2();
         public Frame2()
              setSize (350,350);
              setTitle ("Screen2");
             setVisible (false);
             setResizable (false);
             setLocation(500,500);
              Button btnClose = new Button("Close other frame");
              btnClose.addActionListener (new CloseHandler() );
              add (btnClose);
         public void openWindow()
              setVisible(true);
         private class CloseHandler implements ActionListener
              public void actionPerformed (ActionEvent e)
                 Frame1 f1 = new Frame1();
                   //f1.close();
                   //f1.setVisible(false);
                   f1.dispose();
    }Edited by: Nimzor on Mar 12, 2008 8:35 AM

  • Help - how do I transfer from ipod to library

    Hi all,
    I have downloaded itunes onto a new computer and somehow managed to delete the file (when I thought I was transferring it) from the old computer. Therefore I have lost all of my library. I have still got all my music 5000 songs on my ipod and iphone however. So I'm trying to figure out how to get my music from the ipod and import it back into the library, without itunes wiping everything off my ipod (as current library on new computer) only has all my purchased songs. Alot are from cd's, etc...
    I hope you can help me.
    Thanks

    Sync is only oneway, from PC to your device.  Unless you have the music on your PC, iTunes is going to wipe out what you have on your device if you are syncing to a new library.
    You can only transfer Purchased music over to Itunes on your PC.
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer
    http://support.apple.com/kb/HT1848
    As for you own music, you may have to use a third party software.  A good Free one is called Sharepod which you can download from Download.com here:
    http://download.cnet.com/SharePod/3000-2141_4-10794489.html?tag=mncol;2

  • HELP How to rescue data from a HD with only the Terminal utility working

    I can no longer access the hard disk on a 2008 unibody Mac Book after an failed OS upgrade (?). Running the original OS 10.5.5 from the grey CD-ROM that came with the device and using the "Terminal" utility, I find all data in their place and within the correct structure.
    I tried to make an image of the HD or to copy the files to the external disc using the Hard Disk utility, but all attempts have produced an "operation not possible" message. Target mode will not work, as the device has no firewire connection implemented.
    How can I access the files (I know they are there, I can see them...) and e. g. copy them to an external disc or rescue them with an other method?
    PLEASE HELP ME
    Thank you, Martin
    PS Please don't tell me that experienced users will always have backups of their files: It is my wife's device and that's exactly what I have been telling her for years. Still, it's my wife... 

    Click here and choose 10.5 from the menu for usage instructions. Installing the OS on an external drive is done the same way as doing it on the internal drive, but it needs to be formatted as Mac OS Extended (Journaled).
    (61589)

  • HELP How to download music from Musicstore to play on MP3 Player

    I just bought a okley sunglasses with MP3 Player... How can I buy music in a MP3 format on internet... Apparently the only way to buy/download music from internet on a mac it's with the music store but then it won't allow me to convert it into a MP3 file!!!! Do you have any solutions.. please help me i'm desperate... thanks

    There is a workaround.
    You have to burn purchased music on Audio CD first, then re-import it in the format of your choice.
    If you buy complete albums, this method is economic and you have a backup.
    For single purchases this won't be much of a help.
    M

  • Help , How to get data from database using recordset with UI API

    I want to get a data from database
    when I want to create recordset i notice that UI API didn't has record set
    so I created recordset using DI API (SAPbobscom.recordset and SAPbobscom.company)
    ======================================================
    Dim oCompanyUI As SAPbouiCOM.Company <<UI API
    Dim oRecSet As New SAPbobsCOM.Recordset << DI API
    Dim oCompanyDI As New SAPbobsCOM.Company << DI API
    '=====================================================
    oCompanyDI.Connect
    Set oRecSet = oCompanyDI.GetBusinessObject(BoRecordset)
    oRecSet.DoQuery ("SELECT T0.CardCode, T0.CardName FROM OCRD T0")
    SBO_Application.MessageBox oRecSet.Fields.Item(1).Value
    ======================================================
    but I got an error it said "you are not connected to company"
    I'm really don't have an idea about how to get a data from using UI API (exp I want to get a date or costumer code)
    can someone help me please, I really need it
    Thanks

    you need a single sign on
            Dim oDICompany As SAPbobsCOM.Company
            Dim sCookie As String
            Dim sConnStr As String
            Dim ret As Integer
            oDICompany = New SAPbobsCOM.Company
            sCookie = oDICompany.GetContextCookie
            sConnStr = SBO_Application.Company.GetConnectionContext(sCookie)
            If oDICompany.Connected Then
                oDICompany.Disconnect()
            End If
            ret = oDICompany.SetSboLoginContext(sConnStr)
            If Not ret = 0 Then
                SBO_Application.MessageBox("set Login Context failed!")
                Exit Sub
            End If
            ret = oDICompany.Connect()
            If Not ret = 0 Then
                SBO_Application.MessageBox("Company Connect failed!")
            End If

  • How to display backslashes from a command stored in a variable

    I have a file list of Unix comands with backslashes and other special characters. I am reading it into a loop and running the commands. At present I have :
    cat Udata
    LineNum=1
    while read line
    do
         echo
         echo
         echo "**********************************"
         echo "Process $LineNum"
         echo "Code is     >>  $line"
         echo "Results are: "
         echo
         eval "$line"
         (( LineNum++ ))
    done < hmregraw
    hmregraw is the file with the commands such as
    grep '\tA.:' Udata
    The \ is not printing and in eval it is trying to run
    grep 'tA.:' Udata
    which is wrong. The line being read into the while loop from hmregraw has the \ removed. How can I preserve those backslashes? Is there a way I can do this with out modifying the other departments or creating another duplicate file?
    Thank You.

    The 'read' is removing the \
    Try using read -r
    See man bash

  • Need some help how to generate xml from java bean.

    Hi,
    Can some one help me how to generate the xml format output from a java bean.
    The bean contains around 15 to 20 attribute values.
    Thanks in Advance.
    sarayu

    You can use XMLEncoder with custom persistence delegates if needed:
    http://java.sun.com/products/jfc/tsc/articles/persistence4/

  • Help, how to export emails from mail app

    hi guys: I did not uncheck the box remove emails from the server after ..... so my hotmail on the server are gone. i want to have email copys stores on the server, since i need to check hotmails from any computer, not just on my home computer where the emails backup copys are stored. so i want to export my emails from the mail app in the mac back to hotmail server, how can i do that?? please give me a hand, i will really appreciate

    You can do it via Mailbox>Archive Mailbox. And also, based on what you're saying you have Hotmail set up as an POP account in Mail. Don't know if Hotmail offers it, but if you set up the Hotmail account as IMAP in Mail then the behaviour will be different. You will have two copies of the emails on both the server as well as the computer. Go to Hotmail's help section and type in keyboards like "IMAP" and "Apple Mail."

  • Please help: How to pass variable from main select to subquery

    I have a table with four columns (id, status, start_date and end_date) as follows. What I want is to get the difference between the statuses' start_date to find out how long it takes for the ID to change status. Basically getting the difference of the Start_dates of the statuses for the ID.
    ID         Status               Start_date          End_date
    1         NEW             02-FEB-07        02-FEB-07
    1         OLD             04-FEB-07        06-FEB-07
    1         BAD             09-FEB-07        14-FEB-07
    I had initially thought of doing this
    SELECT ID, (SELECT Start_date from tbl where Status = 'OLD' and ID = 1) - (SELECT Start_date from tbl WHERE Status = 'NEW' and ID =1) from tbl where ID = 1
    but that would not work since I have more than one id and implementing inside Java will be complicated. Please help me what I need to do .. Thank you

    Or this:
    SQL> CREATE TABLE t AS (SELECT 1 ID , 'NEW' status, '02-FEB-07' start_date, '02-FEB-07' end_date FROM DUAL
    UNION ALL SELECT 1 ID , 'OLD' status, '04-FEB-07' start_date, '06-FEB-07' end_date FROM DUAL
    UNION ALL SELECT 1 ID , 'BAD' status, '09-FEB-07' start_date, '14-FEB-07' end_date FROM DUAL
    UNION ALL SELECT 2 ID , 'NEW' status, '02-FEB-07' start_date, '02-FEB-07' end_date FROM DUAL
    UNION ALL SELECT 2 ID , 'BAD' status, '05-FEB-07' start_date, '10-FEB-07' end_date FROM DUAL
    UNION ALL SELECT 2 ID , 'OLD' status, '07-FEB-07' start_date, '10-FEB-07' end_date FROM DUAL
    Table created.
    SQL> ALTER SESSION SET nls_date_format='DD-MON-RR'
    Session altered.
    SQL> SELECT ID,
           status,
           start_date,
           TO_DATE (start_date)
           - LAG (TO_DATE (start_date)) OVER (PARTITION BY ID ORDER BY TO_DATE
                                                                       (start_date))
                                                               diff_of_start_days
      FROM t
                                                    ID STA START_DAT                                 DIFF_OF_START_DAYS
                                                     1 NEW 02-FEB-07                                                  
                                                     1 OLD 04-FEB-07                                                  2
                                                     1 BAD 09-FEB-07                                                  5
                                                     2 NEW 02-FEB-07                                                  
                                                     2 BAD 05-FEB-07                                                  3
                                                     2 OLD 07-FEB-07                                                  2
    6 rows selected.

Maybe you are looking for

  • Passing the values between two pages

    hi all, I am trying to pass the value from one page to another page. by referring the Link http://www.youtube.com/watch?v=4eyzBiIf5MM&feature=related I have created the code based on the demo. it is deployed without any issues. but when i press the h

  • Adobe Download Assistant won't install

    I've tried downloading the Adobe Download Assistant but I get the following message, "The Installer File is Damaged please get a new one from the author". I've tried with Safari, Firefox and Chrome, cleared the cache each time but no luck. I'm attemp

  • MIME emails not showing embedded images

    Hello. When I receive e-mails from a GroupWare solution (extra.groupcare.dk), embedded images are not shown in Mail 3.4. If I use Gmail or any version of Microsoft Outlook, even Mail 2.1 on Tiger it works fine. The images are shown as mime-attachment

  • Dynamic Spatial Cursor?

    I have a working cursor which selects and operates on some spatial data. The cursor uses the GETVERTICES spatial function. The current query works only for geom_id = 347. I need to iterate through all the geometries in the database i.e. repeat the qu

  • WLI Transform COBOL to XML,  But I need Java

              <P>           I am researching the method to takes the results of a CICS transaction which I           get from a Queue in Websphere MQ and converts the response to a java object.           We are currently using Websphere 3.5.4 and for goo