How to control the cursor positon of java program in console mode?

  • Follow


I am writing a small database that requires user input.However, whenever something is output to the screen, the cursor stays at the beginning of the output instead of the end of the output.How can I let it go to the end of the output?For example:say, the output is like this:This is a database. Please input your information below.prompt:>I want the cursor to go to after the ">" sign but it stays in front of "this" although whenever the user presses the keyboard it goes the end after ">".This is not a big problem but makes my application look not so professional.Anyway to cure this?John 
0
Reply John 4/24/2007 1:24:10 AM

John wrote:..>This is not a big problem but makes my application look not so professional.Nothing in a console has 'looked professional' for around the last 2 decades.>Anyway to cure this?GUI  e.g.<sscce>import javax.swing.JOptionPane;class DataBaseFrontEnd {   public static void main(String[] args) {      JOptionPane.showMessageDialog(null,         "<html><body><center>Welcome to the " +         "<br><em>XYZ DataBase Application</em>");      String response = JOptionPane.showInputDialog(null,         "Please enter your information ");      JOptionPane.showMessageDialog(null,         "Sending to D/B: '" + response + "'");   }}</sscce>-- Andrew Thompsonhttp://www.athompson.info/andrew/Message posted via JavaKB.comhttp://www.javakb.com/Uwe/Forums.aspx/java-general/200704/1
0
Reply Andrew 4/24/2007 2:59:25 AM


On Apr 24, 11:59 am, "Andrew Thompson" <u32984@uwe> wrote:> John wrote:>> .>> >This is not a big problem but makes my application look not so professional.>> Nothing in a console has 'looked professional' for> around the last 2 decades.Don't be ridiculous. For example, no serious UNIX database would shipwithout a text mode admin tool.John, you probably need to add some more detail to your question. Whatsort of output are you using? An MSDOS window? A UNIX terminalemulator? The Eclipse console?What are you using to output your text? System.out.println()? Somekind of screen handling library?What are you using to collect input? System.in.read()? Theaforementioned screen handling library?
0
Reply John 4/24/2007 8:03:39 AM

"John Hartnup" <john.hartnup@gmail.com> wrote in message news:1177401819.303585.287130@u32g2000prd.googlegroups.com...> On Apr 24, 11:59 am, "Andrew Thompson" <u32984@uwe> wrote:>> John wrote:>>>> .>>>> >This is not a big problem but makes my application look not so >> >professional.>>>> Nothing in a console has 'looked professional' for>> around the last 2 decades.>> Don't be ridiculous. For example, no serious UNIX database would ship> without a text mode admin tool.>> John, you probably need to add some more detail to your question. What> sort of output are you using? An MSDOS window? A UNIX terminal> emulator? The Eclipse console?>> What are you using to output your text? System.out.println()? Some> kind of screen handling library?>> What are you using to collect input? System.in.read()? The> aforementioned screen handling library?>>> 
0
Reply John 4/24/2007 12:54:38 PM

My input is scanner.nextline();output is System.out.print()System.out.print() or println doesn't make much difference since I can always add "\n" to the end of message.The console here is Eclipse console in windows xp.I haven't tried dos window yet.Not a big deal. Just not so professional.John"John Hartnup" <john.hartnup@gmail.com> wrote in message news:1177401819.303585.287130@u32g2000prd.googlegroups.com...> On Apr 24, 11:59 am, "Andrew Thompson" <u32984@uwe> wrote:>> John wrote:>>>> .>>>> >This is not a big problem but makes my application look not so >> >professional.>>>> Nothing in a console has 'looked professional' for>> around the last 2 decades.>> Don't be ridiculous. For example, no serious UNIX database would ship> without a text mode admin tool.>> John, you probably need to add some more detail to your question. What> sort of output are you using? An MSDOS window? A UNIX terminal> emulator? The Eclipse console?>> What are you using to output your text? System.out.println()? Some> kind of screen handling library?>> What are you using to collect input? System.in.read()? The> aforementioned screen handling library?>>> 
0
Reply John 4/24/2007 12:58:07 PM

4 Replies
776 Views

(page loaded in 0.124 seconds)

Similiar Articles:













7/24/2012 6:40:49 AM


Reply: