Problems with basic java

Hey all,
Im new to this and i appericate any help you can give me:
Im trying to ask the user for a character, and using an if statement output its (predefined) decimal equivelant. But i am having trouble, i think the if statement is fine but its reading the char into a string that im having trouble with, ANY help woudl be gREAT! thanks
import java.io.*;
public class prac3roman1
public static void main(String args[]) throws IOException
          int decimal = 0;
          char numeral;
          String input_string;     
          BufferedReader myInput = new BufferedReader(new InputStreamReader(System.in));
          //System.out.print("Numeral 1: ");
          //input_string = myInput.readLine();     
          //char numeral = input_string.charAt (0);
          if (char numeral = i);
               int decimal = 1;               
          else
               if (char = v)
                    int decimal = 5;
               else
                    int decimal = 10;
          System.out.println("The decimal equivelant is" + decimal);
}

Hi,
Please post this to an appropriate forum. This forum is exclusively related to discussions about Sun Java Studio Creator.
May be you can post here
http://forum.java.sun.com/forum.jspa?forumID=31
MJ

Similar Messages

  • Problems with basic Java JPanel animation using paintcomponent

    okay so I am trying to animate a sprite moving across a background using a for loop within the paintComponent method of a JPanel extension
    public void paintComponent(Graphics g){
    Image simpleBG = new ImageIcon("Images/Backgrounds/Simple path.jpg").getImage();
    Image mMan = new ImageIcon("Images/Sprites/hMan.gif").getImage();
    if (!backgroundIsDrawn){
    g.drawImage(simpleBG, 0, 0, this);
    g.drawImage(mMan, xi, y, this);
    backgroundIsDrawn=true;
    else
    for (int i=xi; i<500; i++){
    g.drawImage(simpleBG, 0, 0, this);
    g.drawImage(mMan, i, y, this);
    try{
    Thread.sleep(10);
    } catch(Exception ex){System.out.println("damn");}
    The problem is that no matter what I set my thread to, it will not show the animation, it will just jump to the last location, even if the thread sleep is set high enough that it takes several minutes to calculate,, it still does not paint the intemediary steps.
    any solution, including using a different method of animation all together would be greatly appreciated. I am learning java on my own so i need all the help I can get.

    fysicsandpholds1014 wrote:
    even when I placed the thread sleep outside of the actual paintComponent in a for loop that called repaint(), it still did not work? Nope. Doing this will likely put the Event Dispatch Thread or EDT to sleep. Since this is the main thread that is responsible for Swing's painting and user interaction, you'll put your app to sleep with this. Again, use a Swing Timer
    and is there any easy animation method that doesnt require painting and repainting every time becasue it is very hard to change what I want to animate with a single paintComponent method? I don't get this.
    I find the internet tutorials either way too complicated or not nearly in depth enough. Maybe its just that I am new to programming but there doesn't seem to be a happy medium between dumbed down Swing tutorials and very complicated and sophisticated animation algorithmns.I can only advise that you practice, practice, practice. The more you use the tutorials, the easier they'll be to use.
    Here's another small demo or animation. It is not optimized (repaint is called on the whole JPanel), but demonstrates some points:
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.image.BufferedImage;
    import java.net.URL;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    @SuppressWarnings("serial")
    public class AnimationDemo2 extends JPanel {
      // use a publicly available sprite for this example
      private static final String SPRITE_PATH = "http://upload.wikimedia.org/" +
                "wikipedia/commons/2/2e/FreeCol_flyingDutchman.png";
      private static final int SIDE = 600;
      private static final Dimension APP_SIZE = new Dimension(SIDE, SIDE);
      // timer delay: equivalent to the Thread.sleep time
      private static final int TIMER_DELAY = 20;
      // how far to move in x dimension with each loop of timer
      public static final int DELTA_X = 1;
      // holds our sprite image
      private BufferedImage img = null;
      // the images x & y locations
      private int imageX = 0;
      private int imageY = SIDE/2;
      public AnimationDemo2() {
        setPreferredSize(APP_SIZE);
        try {
          // first get our image
          URL url = new URL(SPRITE_PATH);
          img = ImageIO.read(url);
          imageY -= 3*img.getHeight()/4;
        } catch (Exception e) { // shame on me for combining exceptions :(
          e.printStackTrace();
          System.exit(1); // exit if fails
        // create and start the Swing Timer
        new Timer(TIMER_DELAY, new TimerListener()).start();
      // all paintComponent does is paint -- nothing else
      public void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.setColor(Color.blue);
        int w = getWidth();
        int h = getHeight();
        g.fillRect(0, h/2, w, h);
        if (img != null) {
          g.drawImage(img, imageX, imageY, this);
      private class TimerListener implements ActionListener {
        // is called every TIMER_DELAY ms
        public void actionPerformed(ActionEvent e) {
          imageX += DELTA_X;
          if (imageX > getWidth()) {
            imageX = 0;
          // ask JVM to paint this JPanel
          AnimationDemo2.this.repaint();
      // code to place our JPanel into a JFrame and show it
      private static void createAndShowUI() {
        JFrame frame = new JFrame("Animation Demo");
        frame.getContentPane().add(new AnimationDemo2());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setLocationRelativeTo(null);
        frame.setVisible(true);
      // call Swing code in a thread-safe manner
      public static void main(String[] args) {
        java.awt.EventQueue.invokeLater(new Runnable() {
          public void run() {
            createAndShowUI();
    }

  • Newbie to blackberry...facing problem with basics

    hi guys,
                 i got my playbook today...........facing problem with basics
             1.how do i perform file actions(like create folder, move,rename)
             2.cant  use drag gesture
             3. ppt applications doesnt show a option to create new presentation(word and xls apps seem to work fine)
             4.can we even download apps from app world to pc  bcuz  everytime it says connect the smartphone to computer even though its physically connected and blackberry desktop manager also shows the device is connected"

    To mange your files, try a file manager like Files & Folders.
    Drag gestures are available in OS 2.0 which should be available before the end of Feb (rumour has it, this week).
    In OS 2 you will also be able to create new PPT presentations.
    To download apps from App World you need to be connected to a Wifi network at the moment.
    Files & Folders, the unified file & cloud manager for PlayBook and BB10 with SkyDrive, SugarSync, Box, Dropbox, Google Drive, Google Docs. Free 3-day trial! - Jon Webb - Innovatology - Utrecht, Netherlands

  • Solution Manager systems RAM requirements - problems with the Java Engine

    Hello,
    I am about to install SAP Solution Manager 7 on a WIndows 2003 Server x64 but I need to know what the RAM requirements are? I have been having problems with the Java Engine starting and it seems to time out, I have heard that this is a very RAM hungry process and it might be why?
    Many thanks for your help in advance,
    Omar

    Hello Omar,
    To size SAP Solution Manager 7.0 EHP1 we recommend to use the SAP Solution Manager Quicksizer Tool at:
    http://service.sap.com/sizing-solman
    Here you find information on how to use the tool, how to collect input data for E2E Scenario Sizing, on SAP E2E RCA Sizing, Introscope Tuning, Wily Enterprise Manager Cluster Setup for E2E RCA Scenario and BI Aggregation Strategy in E2E Scenario.
    Please find more information about installing Solution Manager in:
    http://service.sap.com/instguides -> SAP Solution Manager
    I hope this information helps.
    Thanks,
    Mark

  • JCoIDoc IDocLibrary 3.0.2 Problems with IDocServerExample.java

    Hello, I´m facing a problem with IDocServerExample.java. I created a new project in eclipse, added the package com.sap.conn.idoc.examples and the class IDocServerExample.java. I configured the files "MYSERVER.jcoServer" and "BCE.jcoDestination" and started the application. Then I get the following error messages: *********************************************************************************************************************************************************
    com.sap.conn.jco.JCoException: (102) RFC_ERROR_COMMUNICATION: Unable to get repository at com.sap.conn.jco.rt.DefaultServer.update(DefaultServer.java:136) at com.sap.conn.jco.rt.DefaultServer.(DefaultServer.java:105) at com.sap.conn.idoc.jco.DefaultJCoIDocServer.(DefaultJCoIDocServer.java:35) at com.sap.conn.idoc.jco.DefaultJCoIDocServerFactory.createServer(DefaultJCoIDocServerFactory.java:17) at com.sap.conn.idoc.jco.DefaultJCoIDocServerFactory.createServer(DefaultJCoIDocServerFactory.java:13) at com.sap.conn.jco.rt.DefaultServerManager.getServer(DefaultServerManager.java:108) at com.sap.conn.jco.rt.StandaloneServerFactory.getServerInstance(StandaloneServerFactory.java:170) at com.sap.conn.idoc.jco.JCoIDoc.getServer(JCoIDoc.java:78) at com.sap.conn.idoc.examples.IDocServerExample.main(IDocServerExample.java:18) Caused by: com.sap.conn.jco.JCoException: (102) RFC_ERROR_COMMUNICATION: Connect to message server host failed Connection parameters: TYPE=B DEST=JCOSERVER01 MSHOST=arm115tx GROUP=PUBLIC R3NAME=T01 PCS=1 LOCATION CPIC (TCP/IP) on local host rz1462 with Unicode ERROR service '?' unknown TIME Tue Jul 07 09:09:40 200 RELEASE 711 COMPONENT NI (network interface) VERSION 39 RC -3 DETAIL NiErrSet COUNTER 2 at com.sap.conn.jco.rt.MiddlewareJavaRfc.generateJCoException(MiddlewareJavaRfc.java:615) at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcClient.connect(MiddlewareJavaRfc.java:1280) at com.sap.conn.jco.rt.ClientConnection.connect(ClientConnection.java:661) at com.sap.conn.jco.rt.PoolingFactory.init(PoolingFactory.java:103) at com.sap.conn.jco.rt.ConnectionManager.createFactory(ConnectionManager.java:171) at com.sap.conn.jco.rt.DefaultConnectionManager.createFactory(DefaultConnectionManager.java:44) at com.sap.conn.jco.rt.ConnectionManager.getFactory(ConnectionManager.java:160) at com.sap.conn.jco.rt.RfcDestination.initialize(RfcDestination.java:789) at com.sap.conn.jco.rt.RfcDestination.getSystemID(RfcDestination.java:817) at com.sap.conn.jco.rt.RepositoryManager.getRepository(RepositoryManager.java:32) at com.sap.conn.jco.rt.RfcDestination.getRepository(RfcDestination.java:891) at com.sap.conn.jco.rt.DefaultServer.update(DefaultServer.java:132) ... 8 more Caused by: RfcException: [null] message: Connect to message server host failed Connection parameters: TYPE=B DEST=JCOSERVER01 MSHOST=arm115tx GROUP=PUBLIC R3NAME=T01 PCS=1 LOCATION CPIC (TCP/IP) on local host rz1462 with Unicode ERROR service '?' unknown TIME Tue Jul 07 09:09:40 200 RELEASE 711 COMPONENT NI (network interface) VERSION 39 RC -3 DETAIL NiErrSet COUNTER 2 Return code: RFC_FAILURE(1) error group: 102 key: RFC_ERROR_COMMUNICATION at com.sap.conn.rfc.engine.RfcIoControl.error_end(RfcIoControl.java:255) at com.sap.conn.rfc.engine.RfcIoControl.ab_rfcopen(RfcIoControl.java:94) at com.sap.conn.rfc.api.RfcApi.RfcOpen(RfcApi.java:83) at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcClient.connect(MiddlewareJavaRfc.java:1273) ... 18 more
    Does anyone know what I´m doing wrong? With thanks, Veit

    Im having the same issue here.  Has anyone found a solution to this?

  • Encountering Problems with Basic Sound Tutorial

    Hello everyone,
    I am encountering problems with a basic sound tutorial. I am absolutely confused as to what the problem may be because the code is so simple, and is essentially copied from the textbook. I am convinced that I have done something very silly but cannot see it.
    I have attempted to run this in an appletviewer, Firefox and Internet Explorer. I have attempted to launch it from both a .class file and a .jar file. I have uninstalled and offline installed the JDK and JRE and successfully tested the new installations.
    The audio file I am attempting to load and play is an .AU (Sun/Next 8-bit u-law) audio file I created in Audacity. It is located in the same folder as the AudioApplet.class file.
    My sound system is defintely on, since I have listened to music all day. I have attempted running the program with Media Player closed.
    package edu.myuniversityid.sandbox;
    import java.applet.Applet;
    import java.applet.AudioClip;
    * @author Ibuki
    public class AudioApplet extends Applet
         * Initialization method that will be called after the applet is loaded
         * into the browser.
        public void init()
            super.init();
            AudioClip ac = this.getAudioClip(this.getDocumentBase(), "sample.au");
            ac.play();
    }The code compiles fine, however absolutely I get a small white window when it is run. No sound.
    Thankyou for your time.
    Regards,
    Ibuki.
    PS. I am sure this worked before the university forced me to update my version of Windows to SP2. Hence, the reason for reinstalling Java. Twice.
    Edited by: Ibuki on Jan 31, 2008 11:09 AM becasuse: Added a PS.

    I have attempted this alternative, without success:
        public void init()
            try
                super.init();
                URL url = new URL(this.getDocumentBase(), "sample.au");
                AudioClip ac = this.getAudioClip(url);
                ac.play();
            catch (MalformedURLException ex)
                Logger.getLogger(AudioApplet.class.getName()).log(Level.SEVERE, null, ex);
        }The sample.au is definetly in the correct directory. Both File Explorer and NetBeans confirm this.
    Edited by: Ibuki on Jan 31, 2008 11:59 AM
    I have discovered a temporary solution that works in the applet viewer. The applet will load and plays the correct music perfectly. However, using this code it is not working when I try to deploy it using a web browser (MSIE and FF)!
    public void init()
            super.init();
            AudioClip ac = this.getAudioClip(this.getClass().getResource("sample.au"));
            ac.play();
    Edited by: Ibuki on Jan 31, 2008 12:12 PM
    Eureka!
    Having worked in the applet viewer I managed to get it working in the web browser by simply packaging my SoundApplet.class and sample.au into a .jar archive.
    <html>
         <body>
              <applet code="edu.myuniversityid.sandbox.AudioApplet.class" archive="dist/AudioApplet.jar">Unfortunately, this applet content cannot be displayed on this web page because your current browser does not support Java SE 6! Please <a href="http://www.java.com/">update your version of Java</a>.</applet>
         </body>
    </html>
    public void init()
            super.init();
            AudioClip ac = this.getAudioClip(this.getClass().getResource("sample.au"));
            ac.play();
        }Thankyou everyone.
    This thread can be closed if applicable. I'm not aware of the current moderation policy on this forum.
    Edited by: Ibuki on Jan 31, 2008 12:12 PM

  • Performance problems with new Java Tiger style recommendations

    Performance problems with jdk 1.5 on Linux plattform
    (not tested on Windows, might be the same)
    using the new style recommendations.
    I need fast Vector loops for high speed mathematical calculations, some
    hints about the fastest way to program that loop would be also great!
    After refactoring using the new features from java 1.5 (as recommended from
    SUN) I lost performance significantly:
    using a vector:
    public Vector<unit> units;
    The new code (recommended from SUN for Java Tiger for redesign):
    for (unit u: units) u.accumulate();
    runs more than 30% slower than the old code:
    for (int i = 0; i < units.size(); i++) units.elementAt(i).accumulate();
    I expected the opposite.
    Is there any information available that helps?
    The following additional information I got from Mr. Shankar Unni:
    I got some fairly anomalous results comparing ArrayList and Vector: for the
    1.5-style loops, ArrayList was faster then Vector, but for a loop with get()
    calls, Vector was faster. Vector was even faster than that using
    elementAt(), which was a surprise:
    For a million summing iterations over a 100-element array:
    vector elementAt loop took 3446 ms.
    vector get loop took 3796 ms.
    vector iterator loop took 5469 ms.
    arraylist get loop took 4136 ms.
    arraylist iterator loop took 4668 ms.

    If your topic doesn't change, please stay in your original post.

  • Problems with a java bean in Weblogic 5.1

    Hello,
              I am having a problem deploying a java bean in Weblogic 5.1:
              I have been given a .class and a .jar file for a java bean (not an EJB). I
              placed the .class file into e:\temp\WEB-INF\classes and added the following
              line to my weblogic.properties file:
              weblogic.httpd.webApp.testApp=e:/temp/
              I have also updated the web.xml file in the WEB-INF directory as follows:
              <?xml version="1.0" encoding="UTF-8"?>
              <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
              Application 1.2//EN"
              "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
              <web-app>
              <servlet>
              <servlet-name>EdIface</servlet-name>
              <jsp-file>test.jsp</jsp-file>
              </servlet>
              <servlet-mapping>
              <servlet-name>EdIface</servlet-name>
              <url-pattern>EdIface</url-pattern>
              </servlet-mapping>
              </web-app>
              When I try to access my http:\\server:port\testApp\test I get an "Error
              500 - internal server error".
              Has anyone had experice with deploying a java bean with jsut the .class and
              .jar file? Where should I put the .jar file?
              I appreciate any advice!
              

    Bump

  • A problem with my Java Scrabble game

    Hello
    I am making a Java Scrabble game for a school assignment and I have a problem with the following:
    The number of players is input by the user (2 to 4) and i need to create a number of arrays based on the number of players. These arrays must have 7 playing pieces at all times until the "bag" of pieces has less pieces than those required to replace the ones a certain player just used (in wich case the bag would give that player all of it's remaining pieces and, from this point on, the player arrays would not necessarily need to have 7 pieces).
    this is my procedure to take a piece from the bag:
         public Piece takePiece()
              if (this.pieceCounter > 0) {
                   Arrays.sort(this.pieces, 0, this.pieceCounter);
                   int i = this.generator.nextInt(this.pieceCounter);
                   Piece p = this.pieces;
                   this.pieceCounter--;
                   this.pieces[i] = this.pieces[this.pieceCounter];
                   return p;
              else
                   return null;
    this is my Piece class:
    public class Piece implements Comparable {
         private int scorePiece;
         private char letterPiece;
         public Piece(char letterPiece, int scorePiece)
              this.scorePiece = scorePiece;
              this.letterPiece = letterPiece;
         public int scorePiece()
              return scorePiece;
         public String letterPiece()
              return letterPiece();
         public String toString()
              return letterPiece+ " " + scorePiece;
         public int compareTo(Object a)
              Piece piece= (Piece) a;
              return (int) letterPiece - (int) piece.letterPiece;
    }Thanks in advance for your help

    Ok, if i create a Players class and do this in Main class:
         if(nPlayers >= 2 && nPlayers <= 4)
              Players arrayPlayers[];
              arrayPlayers= new Players [nPlayers ];
              for(int i=0 ; i < nPlayers ; i++)
                       arrayPlayers[i] = new Players ();
              }My Players Class should contain something like this:
             // Array of 7 that contains Pieces...
         Piece[] pieces= new Piece[7];how can i get pieces from takePiece(); (Class Bag) and put them in the pieces arrays until takePiece(); returns null?

  • Problems with basic lower third ?

    Is anyone having a problem with the "basic lower third" template ? I keep getting a second, "ghost" copy of the first (top) line of the title created, shifted about 10 pixels above the original .. this only seems to happen after the project and/or library is saved and re-opened ... FCP X 10.1.4, Macbook Pro Retina ... thanks in advance

    Thanks, but nope, if you look closely, you can see that there is a black drop shadow already set ... unselecting it just gives you the same double image in white, just without the black drop shadow ... bizarrely, it's only ever the top line that is doubled up ... it's as if a second copy of the top line is created ... it is also un-selectable on screen, i.e. if you click on the second copy you can't edit or move it ... the second copy only appears after the project/library is closed and re-opened ... i.e. it all looks fine when you create it

  • Problems with VA Java Visual Composition

    Hi!
    I have some problems with reopening (even simple) visually in VA Java created
    beans (JFrame, JDialog). IDE behaves somehow unpredictable. Sometimes it reopened it into the
    visual composition editor, anothe time the reoppening fails with following log message:
    Java exception during layout of bean(<unnamed>): java.lang.NullPointerException
    Java exception during layout of bean(JFrameContentPane): java.lang.NullPointerException
    An exception occurred in a system program.
    Terminating TimeSlotGUI (VCE) (System) (25/07/01 10:05:07)
    Can anybody help?
    Ivan

    Which Version do you use? This VAJ 3.5 was quite bugy and you had to use patches. Now there is an Update 3.5.2 which fixes most of the bugs ( although there are new ones). When I work with the VCE ( avoid this normally) I get problems if I rename Beans which were generated with th VCE. then your stuff is lost. Sometimes you can recover if you delete the generated[i] initialize() method and then open the VCE.
    Nevertheless, VAJ 3.5.3 works quite good, great debugging tools.

  • Need help with basic Java programming

    I'm having a little bit of trouble with my code. For the sake of argument, I've removed the code I'm having trouble with, because I know it was inaccurate. I'm trying to create a loop so that this program will keep going through and through until the user enters an invalid variable. I thought the default after the case statements was supposed to make the system exit and output my message. Those two problems, the loop and the default, are what I'm really having problems with. My code is posted below.
    import javax.swing.JOptionPane;
    import java.util.Locale;
    import java.text.NumberFormat;
    public class Retail
    public static void main(String args[])
    String firstNum;
    String secondNum;
    String result;
    int prodNum;      //first number to input
    double quantity; //second number to input
    double total = 0.0;     //total of Prod * Quantity Sold for all items
    // To use American Dollar
    NumberFormat moneyFormat = NumberFormat.getCurrencyInstance( Locale.US );
    // first number entered as string
    firstNum = JOptionPane.showInputDialog( "Enter product number 1-5" );
    // second number entered as string
    secondNum = JOptionPane.showInputDialog( " Enter quantity of items sold" );
    // convert values to type double or int from type string
    prodNum = Integer.parseInt( firstNum );
    quantity = Double.parseDouble( secondNum);
    result="";
    if ( prodNum >=1 && prodNum <=5 ) {
    switch (prodNum)
    case 1: // 1st product
    total = 2.98 * quantity;
    break;
    case 2: // 2nd product
    total = 4.50 * quantity;
    break;
    case 3: // 3rd product
    total = 9.98 * quantity;
    break;
    case 4: //4th product
    total = 4.49 * quantity;
    break;
    case 5:
    total = 6.87 * quantity;
    break;
    default: JOptionPane.showMessageDialog( null, "Wrong product number entered" );
    JOptionPane.showMessageDialog( null, moneyFormat.format(total), "Total Price of Items Purchased", JOptionPane.INFORMATION_MESSAGE );
    System.exit(0);
    ***I know I need to put something in the user input message to state that any value other than 1-5 entered will cause the program to skip to the output, I'll put that in later.***

    When you post code, please use [code] and [/code] tags as described in Formatting Help on the message entry page. It makes it much easier to read and prevents accidental markup from array indices like [i].

  • HT5559 I  can't connecting  to chat  please can you help me,i think my problem with da java

    I  can't connecting  to chat  please can you help me,i think my problem with da java

    Have you read thread (From More like this on the right)
    https://discussions.apple.com/message/18837278#18837278

  • Problem with Sun Java Creator JDBC driver .....

    Hi:
    I am new to Java Studio Creator. I am using Oracle Enterprise Edition 8.0.5.0 database to get data from. Through Servers Navigator->Data Sources, I define a new datasource using default JSC JDBC driver for Oracle. However, when I try to test the connection I get the following error.
    [sunm][Oracle JDBC Driver] Internal Error: Net8 Protocol Error
    Can someone tell me what is going on here? By the way I also have Netbeans 4.0 IDE which works fine with the same database.
    -Victor bagga

    I was using the following database URL.
    jdbc:sun:oracle://autoserv.cqtel.com:1521;SID=autosvdb
    The SID is valid because I can use other JDBC drivers such as Oracle's thin driver which uses the Database URL
    jdbc:oracle:thin:@autoserv.cqtel.com:1521:autosvdb
    and it works. However, I can not use the Oracle thin JDBC driver with Sun Java Creator as it seems to be incompatible. Using this driver I can successfully define a datasource and veiw all the data and make all kind of queries through the Server Navigator window but when I try to drop a database table on to a Data Table in my project, nothing happens. If I try to Edit the query on the rowset, the GUI window does not show any Column names and display names.
    By the way, I also have an Oracle 9.x database which works just fine with Java Ctreator Studio. I really like Java Creator as I find it very productive but not being able to make it work with Oracle 8.0.5.0 takes the fun out of it.

  • Problem with Cut.java sample

    I am attempting to use code from the Cut.java sample to cut multiple
    regions from the same source audio file to separate destination files.
    I am calling the doIt() method from my coding, passing MediaLocators to
    the input and output files (both .wav) , and arrays with a single
    element (time in ns as a long) for the start and end, and false for
    frame mode. The first time I call it, it works fine. However, on
    subsequent calls, despite the output messages suggesting it has worked
    successfully, the output files are full of white noise. I have tried:
    using a new instance of Cut each time
    adding code to close the processor and disconnect the datasink
    disabling JMF buffering
    all to no effect. Any suggestions would be greatly appreciated.
    cheers
    Matthew Wilson.

    I have kind of the same problem too.
    I copy-paste the "cutting sections from an input" example from http://java.sun.com/products/java-media/jmf/2.1.1/solutions/Cut.java but can't get it to work.
    The error I'm getting back is:
    - Create processor for: file:/c:/song.mp3
    - Configure the processor for: file:/c:/song.mp3
      Transcode:
         from: mpeglayer3, 44100.0 Hz, 16-bit, Stereo, LittleEndian, Signed, 16000.0 frame rate, FrameSize=32768 bits
         to: LINEAR, 44100.0 Hz, 16-bit, Stereo, BigEndian, Signed
    - Realize the processor for: file:/c:/song.mp3
    Failed to build a graph for the given custom options.
    Failed to realize: com.sun.media.ProcessEngine@19360e2
      Cannot build a flow graph with the customized options:
        Unable to transcode format: mpeglayer3, 44100.0 Hz, 16-bit, Stereo, LittleEndian, Signed, 16000.0 frame rate, FrameSize=32768 bits
          to: LINEAR, 44100.0 Hz, 16-bit, Stereo, BigEndian, Signed
          outputting to: RAW
    Error: Unable to realize com.sun.media.ProcessEngine@19360e2
    Failed to realize the processor.
    Failed to cut the inputsince I'm using eclipse as IDE, I made some "minor" changes on Cut.java to test it on eclipse
    public static void main(String [] args) {
        args = new String[7];
        args[0] = "-o";
        args[1] = "file:/c:/tmp.mov"; //outputfile
        args[2] = "file:/c:/peli.mov"; //inputfile
        args[3] = "-s";
        args[4] = "5000";
        args[5] = "-e";
        args[6] = "25000";
        //no more changes...Does any one have an idea what do I'm doing wrong? I'll appreciate ur help.

Maybe you are looking for