Knight tour programming with only basic java

i had this assignment from school which ask us to create a program to calculate how many posssibilities to complete knight's tour from a position using basic java and not using applet. So far i can only create an incomplete program which can only go a speccific way and is also incomplete. i am trying to understand the jaava applet type of knight tour program but got too confused as i have just started learning this. Please help me with this.
here's my code:
public class uk16638_a3{
     public static void main(String[] args){
     int horizontal[] = {2,1,-1,-2,-2,-1,1,2};
     int vertical[] = {-1,-2,-2,-1,1,2,2,1};
     int chessBoard[][]=new int[8][8];
     int move, currentRow = 0, currentCol= 0, move_count = 0, new_vert, new_horz;
for(int i=0; i<8; i++)
     for(int j =0; j<8; j++)
          chessBoard[i][j] = 0;
chessBoard[0][0] = 1;
do{
for(move=0;move<8;move++){
new_vert = currentRow + vertical[move];
new_horz = currentCol + horizontal[move];
if ( (new_vert>=0) && (new_vert < 8) )
if( (new_horz>=0) && (new_horz < 8) )
if( chessBoard[new_horz][new_vert]==0 ) {
chessBoard[new_horz][new_vert] = 1;
move_count++;
currentRow = new_vert;
currentCol = new_horz;
}}}while(move<8);}}

Sorry with the inconvenience cause i am new with this forum so i am causing many problems to all of you. here's the full code i put but i would really like to ask someone to teach me on creating a backtrack and let the knight moves following a different sequence from the one i already set.
public class uk16638_a3{
public static void main(String[] args){
//the movements of a knight horizontally and vertically
int horizontal[] = {2,1,-1,-2,-2,-1,1,2};
int vertical[] = {-1,-2,-2,-1,1,2,2,1};
int chessBoard[][]=new int[8][8];
int move, currentRow = 0, currentCol= 0, move_count = 0, new_vert, new_horz;
//setting all elements in the array to 0
for(int i=0; i<8; i++)
for(int j =0; j<8; j++)
chessBoard[i][j] = 0;
//the knight starts here
chessBoard[0][0] = 1;
//using do while loop, i try to move the knight following the sequence i had already set in the array above. But because its moving at the same direction all the time, it gets stuck.
do{
for(move=0;move<8;move++){
//setting the new coordinates for it to move to
new_vert = currentRow + vertical[move];
new_horz = currentCol + horizontal[move];
if ( (new_vert>=0) && (new_vert < 8) )
if( (new_horz>=0) && (new_horz < 8) )
//new position check if its already occupied or not, if occupied it will move on to the next part of the move sequence i set
if( chessBoard[new_horz][new_vert]==0 ) {
chessBoard[new_horz][new_vert] = 1;
move_count++;
//current coordinate of the new knight position
currentRow = new_vert;
currentCol = new_horz;
}}}while(move<8);}}
Edited by: Mikki88 on Mar 2, 2009 1:53 AM

Similar Messages

  • Help with my basic java

    Hello i am in a high school programming class and i need help. I have to make an application that draws a basic face, and then i put in different scrollbars, drop menus and checkboxes to control how the face works. I have gotten most of what i need to do but i am stuck on, I need to have a so if i press it they will get closer together of farther apart, which is where im stuck. i can only make them move in the same direction. any ideas???
    heres the code.
    import java.awt.*;
    import java.awt.event.*;
    public class Unit9q extends java.applet.Applet implements AdjustmentListener,ItemListener {
         Graphics g;
         Checkbox mybox1,mybox2,mybox3,mybox4,mybox5;
         CheckboxGroup mygroup1,mygroup2;
         Choice mymenubar1,mymenubar2;
         String colorword,shapeword,menuitem1,menuitem2,eyefill,eyesstring;
         Color clr;
         int yaxis,inteyes,ineyes;
         Scrollbar yaxisscroll,eyes;     
         public void init() {
              yaxisscroll=new Scrollbar(0,50,1,120,140);
              yaxisscroll.addAdjustmentListener(this);
              yaxisscroll.setBounds(100,10,100,20);
              add(yaxisscroll);
              yaxis=120;
              eyes=new Scrollbar(0,50,1,120,140);
              eyes.addAdjustmentListener(this);
              eyes.setBounds(100,10,100,20);
              add(eyes);
              inteyes=110;
              mygroup1=new CheckboxGroup();
              mybox1=new Checkbox("Red",mygroup1,false);
              mybox2=new Checkbox("Blue",mygroup1,false);
              mybox3=new Checkbox("Green",mygroup1,false);          
              mybox4=new Checkbox("Filled",mygroup2,false);
              mybox5=new Checkbox("Outlined",mygroup2,false);
              add(mybox4);
              add(mybox5);
              mybox1.addItemListener(this);
              mybox2.addItemListener(this);
              mybox3.addItemListener(this);
              add(mybox1);
              add(mybox2);
              add(mybox3);
              clr=Color.white;
              mymenubar1=new Choice();
              mymenubar1.addItem("Square");
              mymenubar1.addItem("Circle");
              mymenubar1.addItem("Rectangle");
              mymenubar1.addItem("Oval");
              mymenubar1.addItemListener(this);
              mymenubar2=new Choice();
              mymenubar2.addItem("Square");
              mymenubar2.addItem("Oval");
              mymenubar2.addItemListener(this);
              add(mymenubar1);
         public void adjustmentValueChanged(AdjustmentEvent event){
              yaxis=yaxisscroll.getValue();
              inteyes=eyes.getValue();
              repaint();
         public void itemStateChanged(ItemEvent event) {
              menuitem1=mymenubar1.getSelectedItem();
              menuitem2=mymenubar2.getSelectedItem();
              if (mybox1.getState()==true) {clr=Color.red;}
              else if (mybox2.getState()==true) {clr=Color.blue;}
              else if (mybox3.getState()==true) {clr=Color.green;}
              repaint();
         public void paint(Graphics g) {
              g.setColor(Color.black);
              if (menuitem1.equals("Rectangle")){
                   g.drawRect(100,100,70,90);}
              else if (menuitem1.equals("Oval")){
                   g.drawOval(100,100,75,90);}
              else if (menuitem1.equals("Circle")){
                   g.drawOval(100,100,80,80);}
              else if (menuitem1.equals("Square")){
                   g.drawRect(100,100,80,80);}     
              if (menuitem2.equals("Circle")){
                   g.drawOval(80,100,10,10);}
              else if (menuitem2.equals("Square")){
                   g.drawRect(80,100,10,10);}     
                        g.setColor(clr);
              if (mybox4.getState()==true) {
                   g.fillRect(inteyes,120,10,10);
                   g.fillRect(ineyes,120,10,10);}
              else if (mybox5.getState()==true) {
                   g.drawOval(inteyes,120,10,10);
                   g.drawOval(ineyes,120,10,10);}     
              ineyes=inteyes+42;
              g.setColor(Color.black);     
              g.fillOval(128,yaxis,15,22);
              g.drawArc(111,160,50,20,0,180);     
         } //thank you if you can solve it

    Next time you post code, use the CODE button or [code] and [/code] tags so that it maintains the formatting from your editor.
    If two things are moving int the same direction, your adding N to both of their x-coordinates. If you want one to move in one direction and the other in the other direction, then you have to add N to one and -N to the other.

  • Need help with a basic java thing..

    Sorry, just started java a few weeks ago and i'm having trouble figuring out how to do something.
    I wanted to know how to make this work. It cant be more than 6 characters in length and of those six characters, the first two have to be letters only, followed by a dash (-) and then three numbers. EG: ab-234 or gf-643...
    Im using it as a serial number generator type thing, thats only one part of the entire program, but I cant figure it out.
    Just need the most basic way to do that if anyone could help! been looking for hours in a couple java books i have and dont know where to look or what to look for!!
    Any help figuring out the code for that would be great! Here's what I have so far and how i need the rest to be implemented! Thanks! PS: using TextIO
    <code>
    String itemNum1
         itemNum1 = new String ( " Enter Item Number(AB-123): " );
         TextIO.put("\n" + itemNum1);
         itemnum = TextIO.getlnString();
    </code>

    Oh hey sorry, i figured the bit of text i put in there
    would be enough. I basically need a user to enter the
    information, but i just need to know (or get a hint)
    of how to prevent them from entering an invalid
    number/serial code type thing in regards to the
    parameters that I need met. (such as no more than 6
    chars, but alternating numbers/letters). I presume I
    use the char and not the getlnString command but
    nonetheless im still stuck as to how I'd manage that.
    Do i need to code each character seperately? (such as
    letters by themselves, then another prompt to enter
    the numbers??) or is there a way to get it all in one
    go?
    Thanks for any advice! oh and Sorry for the bad
    wording in my question :P.
    You could read the String from console using something like
    public static String readWord()
       {  int ch;
          String r = "";
          boolean done = false;
          while (!done)
          {  try
             {  ch = System.in.read();
                if (ch < 0
                   || java.lang.Character.isSpace((char)ch))
                   done = true;
                else
                   r = r + (char) ch;
             catch(java.io.IOException e)
             {  done = true;
          return r;
       }you would have to modify it according to your needs and after that you could use the String API to confirm if the user has entered it right or not. If not you could ask him to do that again

  • How to used parameter in example program with visaul basic

    i have some proplem about away to used parameter in visual basic example program for ex. As Status ,As ViSession because it can't complier

    Jone –
    Greetings from National Instruments! I hope you are finding your use of the Developer Exchange discussion forum advantageous. We really believe that this is a great resource for programmers to gather and work with each other, sharing tips and working together to answer questions.
    I am not 100% sure about which specific Visual Basic you are inquiring. However, the NI-VISA User Manual contains many specific Visual Basic examples that I think would greatly help you in these programming pursuits. I would suggest that you take a look at this link (http://digital.ni.com/manuals.nsf/websearch/266526277DFF74F786256ADC0065C50C?OpenDocument&node=132100_US), specifically Appendix A. There you will find many examples, including specific declarations,
    which I think is the point of your entry here.
    I hope that this helps you out! Thanks again for your support of National Instruments and your use of the Developer Exchange!!
    Best Regards,
    Greg Wempe
    Applications Engineer

  • How to run GPIB based programs with visual basic 3

    I have a little test program to comunicate with a GPIB device in a similar way that MAX does.
    I type the address of the device, send the command *IDN?
    but nothing returns except an error message that says s$ duplicate definition. I'm not terribly familiar with VB 3.0 Does anyone know what this means and how to fix it?

    I'm assuming since you're using VB 3, I assume you're calling directly into gpib-32.dll - is that correct? Could you possibly post the VB code? Also, if it's possible for you to use a later version of VB, we have ActiveX controls for VB6 and .NET classes for VB.NET that would make GPIB-based I/O much simpler to do than it would be in VB 3.0

  • How can i run my java program with out java language

    Hai to every one ..Iam new to java language ...am using windows xp operating system , i did not installed java language in my system .. how can i run a java program with out installing java language... Which files is requied to run java program..?
    any one can help me??

    Hai to every one ..Iam new to java language ...am
    using windows xp operating system , i did not
    installed java language in my system .. how can i run
    a java program with out installing java language...
    you ... can ... not ... do ... this
    Which files is requied to run java program..?
    any one can help me??a JVM. Download it from sun's website.
    [url http://java.sun.com/javase/downloads/index.jsp]Download JavaSE here

  • Multiple programming language website(including Java)

    I have to design a website for a startup business based out of New York. I actually have yet to be briefed as to the nature of the business but that's besides the point. What I'm trying to figure out is in what areas of the website would it be best to implement Java/Javascript. I know html, css, and will use PHP for database access. Now that the intro is out of the way, here are my questions.
    -Can Java access/create databases, namely MySQL?
    -The website needs to be graphically well put together, I was actually going to use the sun.com website for a model. Would Java be best for graphics or should I stick to CSS?
    -Is it possible to make a workable website(images, databasing, editing) with only a Java applet?
    Just for the record, I'm still learning Java, and I'm fairly fluent with html,css, and php.
    Any help would be appreciated.

    Yes, Java can definitely access databases (including MySQL). The keyword here is JDBC.
    Avoid Java on the client side for "normal" websites. Just use it to generate classical website formats (HTML, CSS, ...) on the server side.
    You probably could produce an entire website inside an Applet, but I'd suggest strongly against it (as you'd lock out anyone who doesn't have/want Java installed on his PC, also there'd probably be accessibility problems).

  • Can anybody send me ebook for 'oracle 10g programming with pl/sql'

    Hi
    can any one send me ebook for oracle's 'oracle 10g programming with pl/sql', 'java'
    My mail id is: [email protected]
    Thanking in advance.

    I hope it can guide you to get ebooks for your request.
    http://www.oracle.com/technology/tech/pl_sql/index.html
    Cheers
    Vigneswaran

  • Never programmed with Java

    Hello
    I have never programmed with Java, and dont know, what i can do, I use PHP, but, i am only a novice at it.
    I was wondering, is it possable to get data from a page, and put it into an image? if there is no data from the page, it will ask for the data to be added, and this will update every so often?
    Also, Most of you know about google maps, where you can search for something, well, can i do this same thing in java, have a map, not of the earth, but for a game, and make it easy to add different parts, so that we can search for it, and people can find it easy to look for what they are looking for?

    I think Google Maps is programmed in JavaScript using AJAX (short for Asynchronous JavaScript and XML) and is what as known as a web application. Google has released an API (still in beta) for working with Google Maps. The webpage for this API is http://www.google.com/apis/maps/. More about the development facilities Google provides can be found at http://code.google.com/.
    I've never read the source code to Google Maps before (a lot of which is available by just viewing the source code of the Google Maps webpage, which can be done by clicking, View > Source in Internet Explorer and View > Page Source in Mozilla Firefox), however I don't think it is a terribly complex application (this does not mean, however, that the source code is easy to read). I think the way it works is by requesting individual images as needed from the Google server and piecing them together on the client side (i.e. in the browser). Basically what you would need to do to use their existing code is to replace all requests made to the Google server with requests to a server of your own and have the server return the corresponding images. This might not be particularly easy to do.
    In my opinion, a better approach is just to write your own custom application (probably in Java) which simply mimics the behavior of Google maps, except with your own custom images. This way, you don't have to reverse engineer an entire web application before beginning to write one.
    Writing your own application for this purpose is not as difficult as it sounds, especially not in Java. Once understanding the basics, you will not be too far off from being able to write your application.
    Let's start with the most basic program (this program would be located in a file called Program.java):
    public class Program {
       public static void main(String[] args) {
    }This program simply starts, does nothing, and exits. I will explain this piece of code line by line, but first, I would like to gauge how much you already know to figure out how best to explain this. Have you used classes in PHP before?

  • Can I run adobe master collection in a windows partition on a basic mbp 13" with only the intel chipset?

    can I run adobe master collection in a windows partition on a basic mbp 13" with only the intel chipset?
    I want to install 16 gb ram but I don't think I can change the lack of video card. I wanted this basic machine because it has fairly long battery life. I don't need or want retina at this time. My model is the mid 2012 model. I am running the adobe collection for mac, I want to run the windows versions. Is it possible? What is the most ram I could access using something like fusion 5, assuming I could get fusion 5 to work? would it refuse to run because of the intel chipset and lack of video card?
    If I'm wrong and there is a way to add a video card to this model, could some version of fusion and windows 7 access more than 2 gb operating ram?
    What  cost would I be incurring, and would it be cheaper to buy a windows laptop with more ram than I could access via a virtual machine?
    I want to work on a client's work in the windows versions of the creative suite, with occasional usage of after effects for windows, and to use some web plug-ins only available in windows versions, and to try some windows-only video and audio software.
    thanks for any suggestions. While many people have told me I can run everything on my macbook, I am concerned about what I think is a limited amount of ram that can be accessed over the virtual machine partition softwares, and I don't know if what I want to attempt is actually possible.
    My mbp os is 10.8.2 on a 2.5 GHz intel core i5 4 gb 1600MHz DDR3 with 500 hard drive. the basic 13" mid 2012 machine.
    I'm hoping to install 16 G of opertating ram to allow more adobe programs to run concurrently- just when I am working on the mac side.
    also, off track but, for years I have wanted a small  machine that is more easily portable than my 15" machines. I have only had this used machine for a few weeks, but already I have been very satisfied and used it for presentations at clients. I don't want an air because I really want the dvd burner and player. No matter what apple says about wireless, there are decades of legacy work stored on optical discs all over the world, and I don't want to be unable to open something at a client's office because I don't have a dvd drive. Additionally, I have very large files I want to transfer via ethernet or firewire so that the transfer will take less time and be more secure than wifi. I resist apple's trend to make every machine a disposable toy that is viable only a year or so. I have read reviews that label the mbp it a poor value compared to the air. If all you need to do is text and communicate via wifi, many devices will sufice, and an air is certainly the most elegant. But what about the cost of large ssd's and protecting the drive against damage from shock? I want to be able to move this thing around and the small size is much safer inside my padded bag when I sit in narrow airplane seats, crowded trains and other congested spaces. I am much more likely to be able to borrow a large screen in a client's office ( with the use of one of the three adapters I had to buy) than to be able to borrow a dvd drive that has drivers for mac os 10.8.2. I suspect this may be the last generation of machines that have optical drives and ethernet, and that was why I purchased it so that I could continue to do work into the next few years. I am impressed by the retina display, but I need long battery life. And as beautiful as the retina display is, it is even more of a problem when trying to cross platform with the windows world. I wish I could infuence apple to do a trial product flow for a machine designed to work with 80% of the business world that uses windows. How spectacular that would be. With all their expertise and adept hardware design, to create a machine that cross platforms better than a windows machine itself works? Now that would be an accomplishment.  Instead of 8 or 9 percent of the total computer sales, why not aim for a higher percentage? Smart devices will keep moving toward portable computers in power, anyway.

    confused, bothered and bewildered wrote:
    can I run adobe master collection in a windows partition on a basic mbp 13" with only the intel chipset?
    I want to install 16 gb ram but I don't think I can change the lack of video card. I wanted this basic machine because it has fairly long battery life. I don't need or want retina at this time. My model is the mid 2012 model. I am running the adobe collection for mac, I want to run the windows versions. Is it possible? What is the most ram I could access using something like fusion 5, assuming I could get fusion 5 to work? would it refuse to run because of the intel chipset and lack of video card?
    If I'm wrong and there is a way to add a video card to this model, could some version of fusion and windows 7 access more than 2 gb operating ram?
    What  cost would I be incurring, and would it be cheaper to buy a windows laptop with more ram than I could access via a virtual machine?...
    Fusion should work on your machine and if you put 16 GB of RAM in (see http://eshop.macsales.com/shop/memory/Apple_MacBook_MacBook_Pro/Upgrade/DDR3_160 0MHz_SDRAM), Fusion can access a good portion of that. Also, in a Virtual Machine, the guest OS is presented with Fusion's video card emulation, not what's in hardware on your Mac. Of course, finding Windows 7 now that Win 8 has been released could take some doing and the Win 8 Pro upgrade price is supposed to jump to $200 the end of the month. Add that to the price of Fusion and the extra RAM and you're beginning to get into the realm of low end real PC's.
    As to cross platform, I assume you're aware of BootCamp (http://support.apple.com/kb/HT1461).

  • Is it possible to create java standalone programs with java ME 8

    Hi,
    Comparing java ME to java SE, I have the impression that midlets are similar to applets.
    When working with java SE, I usually make standalone programs.
    Now, I wonder if it is also possible to create also standalone programs for java ME, if the classes are only  using java ME API's.
    I already noticed that netbeans does not allow to build a project that does not contain a midlet, but maybe, it is possible to create a jar file
    using the javac and jar commands. Or is there a specific reason why netbeans does not allow to build a project without midlets?
    The reason for asking is, that I often make small tools in java that ae then called from a linux script. I imagine that this might be useful on the raspberry pi as well.
    Thanks in advance
    Jef

    Hi Jef -
    Comparing java ME to java SE, I have the impression that midlets are similar to applets.
    Sort of - similar life cycle methods - so conceptually, yes.
    Now, I wonder if it is also possible to create also standalone programs for java ME, if the classes are only  using java ME API's.
    In a way, yes. If you build an project, you will notice a JAD file and JAR file in the dist directory of the project.  JAD is the descriptor for a MIDlet - in mobile devices, the JAD
    file is loaded first to determine if the MIDlet has enough privileges to load and run, before the corresponding JAR file is downloaded.
    However, the JAD file can also be included in the Manifest of the JAR and the JAR copied to the embedded device manually and run there.
    I already noticed that netbeans does not allow to build a project that does not contain a midlet, but maybe, it is possible to create a jar file
    using the javac and jar commands. Or is there a specific reason why netbeans does not allow to build a project without midlets?
    You can build JAR files and include them into Java ME Embedded projects, but just like Applets, to use the Application Management System (AMS) on the Raspberry Pi, you must have a MIDlet to run.
    Perhaps you mean that you would like to launch the AMS and load a MIDlet from the command line on the Pi?
    If so, take a look at this section of the Getting Started Guide for the Raspberry Pi.
    Tom

  • Basic Java Program help needed urgently.

    I have posted the instructions to my project assignment on here that is due tomorrow. I have spent an extremely large amount of time trying to get the basics of programming and am having some difficulty off of the bat. Someone who has more experience with this and could walk me through the steps is what I am hoping for. Any Help however will be greatly appreciated. I am putting in a lot of effort, but I am not getting the results I need. Thank you for the consideration of assisting me with my issues. If you have any questions please feel free to ask. I would love to open up a dialogue.
    CIS 120
    Mathematical Operators
    Project-1
    Max possible pts 100
    Write a program “MathOperators” that reads two integers, displays user’s name, sum, product,
    difference, quotients and modulus of the two numbers.
    1. Create a header for your project as follows:
    * Prgrammer: Your Name (1 pt) *
    * Class: CIS 120 (1 pt) *
    * Section: (1 pt) *
    * Instructor: (1 pt) *
    * Program Name: Mathematical Operators (1 pt) *
    * Description: This java program will ask the user to enter two integers and *
    display sum, product, difference, quotients and modulus of the two numbers
    * (5 pts) *
    2. Display a friendly message e.g. Good Morning!! (2 pts)
    3. Explain your program to the user e.g. This java program can add, subtract, multiply,
    divide and calculate remainder of any two integer numbers entered by you. Let’s get
    started…. (5 pts)
    4. Prompt the user- Please enter your first name, store the value entered by user in a
    string variable name. Use input.next() instead of input.nextLine(). (8 pts)
    5. Prompt the user- name, enter first integer number , store the value entered by user in
    an integer variable num1.(5 pts)
    6. Prompt the user- name, enter second integer number , store the value entered by user in
    an integer variable num2.(5 pts)
    7. Display the numbers entered by the user as: name has entered the numbers num1and
    num2.(5 pts)
    8. Calculate sum, product, difference, quotients and modulus of the two numbers. ( 30 pts)
    9. Display sum, product, difference, quotients and modulus of the two numbers. ( 10 pts)
    10. Terminate your program with a friendly message like- Thanks for using my program,
    have a nice day!!(2 pts)

    Nice try. You have not demonstrated that you've at least TRIED to do something. No one is going to do your homework for you. Your "urgency" is yours alone.

  • Why can't I run my Java program with just the JRE, the JDK is required?

    I've recently written 3 programs in Java using the Netbeans IDE with JDK 1.6 as the default Java platform. The compile-time libraries include the Swing Application Framework. I use BuildDesk from ProductiveMe to package the each program into a Windows installer.
    When I install the programs on a new computer without a JRE or JDK being present, and attempt to run them I get an error (as expected) stating that there is no JVM. The messages says that I need to install JDK 1.3 or higher. I downloaded the latest JRE onto the new computer and attempted to run the programs and I get the same error message. My question is, why can't I run these programs with just the JRE installed? Why do I need the JDK? When I install the JDK, the programs run fine. The typical user may not have the JDK on their system, but they likely have the JRE if they've run Java programs before.
    Is the answer as simple as there must be library functions being used by the programs that belong to the JDK, but not the JRE? I'd rather a user not have to install the JDK verses the JRE because they may also have to update some Windows environment variables.
    Thank you for any help on this issue.

    915088 wrote:
    Thanks for your replies. I further investigated BuildDesk and found an option which allows a JVM check but that check needs the JDK. I stopped the JVM check and rebuilt using BuildDesk and it now only requires the JRE to run the programs. The reason why I use BuildDesk is to package more than just the jar file for the user. BuildDesk allows me to create a installation folder structure as well as include any other files in the build. I could just as well zipped all this together for the user but decided against that method.I don't think anyone will question your usage of an installer tool; that is entirely up to you. But what is questionable is that you have problems with that installer tool and then go look for help in a Java programming forum. The next time, go look for help at the source. If there is no way to acquire help (support, a forum, a mailinglist, anything) then that is a very good reason to not use the product in question.

  • Problems running bat file with calls to java programs (.jar)

    I created a bat file with calls to jar programs. In each line,
    I put a call to the programs with parameters, but bat only
    executes the first line and ends execution.
    All lines of my bat file must be executed.
    What should I do?
    Best Regards,
    Pedro Felipe
    [http://pedrofao.blogspot.com|http://pedrofao.blogspot.com]
    [http://viajantesmundo.blogspot.com/|http://viajantesmundo.blogspot.com/]

    user8730639 wrote:
    I realized that the problem isn`t my bat file. I made tests calling another jar files and then all the lines of the batch file were executed. So, the jar file called on my previous bat is finnishing the execution. I verified and the jar apps worked without error.
    I would like to know if exists any command in Java that can cause this effect (close a batch), to modify the open source code of the application.Not that I know of.
    Is prism a bat file?
    If you are invoking bat files from your bat file without using call that would explain it
    :: mymain.bat file
    :: call the first bat file
    call prism.bat arg1 arg2 arg3
    :: call the other bat file
    call prism.bat arg4 arg5 arg6
    ::

  • Can't run java program with GUI

    My computer can run java program properly.
    However, for those program with GUI (using swing),
    my computer is unable to display the GUI.
    What's wrong with it? Is there any PATH I need to set before running GUI program?
    Thanks
    icedgold

    Cut, copy, paste then compile and run this;-import java.awt.*;
    import javax.swing.*;
    public class MyJFrame extends JFrame {
      public MyJFrame() {
          super("My first JFrame");
          Container c  = getContentPane();
          JPanel panel = new JPanel();
          panel.setBackground(Color.white);//  (new Color(255, 255, 255));
          JLabel jl = new JLabel("Yes it works");
          panel.add(jl);     
          c.add(panel);
      public static void main(String[] args) {
        MyJFrame frame = new MyJFrame();
        frame.setSize(180,120);
        frame.setLocation(200, 300);
        frame.setDefaultCloseOperation( EXIT_ON_CLOSE );
        frame.setVisible(true);
    }

Maybe you are looking for