|
Thanks, I obviously missed that.
|
|
|
|
|
I have been there several times, don't worry
You are welcome
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Why in a Java program that asks for user input the blinking cursor is not positioned where it should be.
Look at this code:
public class GettingInput
{
public static void main(String args[])
{
int x;
int y;
Scanner in = new Scanner(System.in);
System.out.print("Enter a number: ");
x = in.nextInt();
System.out.print("Enter another number: ");
y = in.nextInt();
int sum = x + y;
System.out.println("Sum is " + sum);
}
}
When I run the program the blinking cursor is never where it should be. Seems to me it should be after the word number: cursor should be here.
But I can never get it there.
Is there something I'm doing wrong when I run my program or is this just a Java quirk?
|
|
|
|
|
So where does it happen to be? That works perfectly fine in my case, I ran your code in NetBeans and the following was the output,
run:
Enter a number: 55
Enter another number: 45
Sum is 100
BUILD SUCCESSFUL (total time: 14 seconds)
You can see "55" comes right after "number: " and so on for the next line. The question is which compiler are you using, or what IDE is being used? print must never add "\n" to the output, if that is happening, change the compiler.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
I'm using Eclipse Mars. When I run the program it first shows Enter an integer: with no cursor being shown. I then enter a number and then hit Enter and then what happens is it shows Enter an integer: the second time around but the cursor shows up before the Enter an integer:
It's just dumb.
Why doesn't the cursor automatically get placed after the Enter an integer:
Just annoys me. I'm using Eclipse Mars with whatever compiler the JDK ships with.
|
|
|
|
|
That sounds more like an issue with your PC or console settings.
|
|
|
|
|
Not a computer issue. Many people have reported the same thing across the Web.
|
|
|
|
|
I Googled for that and did not find any references that match your problem.
|
|
|
|
|
Might be a problem with the IDE ?
|
|
|
|
|
My slides contains pictures ,editable Charts, tables etc.,
|
|
|
|
|
|
How do we work on the analysis of the periods of ECG ,example Qr alone, and so, therefore, to be compared with the original signal using java .
Regards
|
|
|
|
|
|
Learning Java, reading:
"Java the Complete Reference", Ninth Edition
This is regarding JavaFX.
Writer's code:
ImageView hourglassIV = new ImageView("hourglass.png");
Label hourglassLabel = new Label("Hourglass", hourglassIV);
rootNode.getChildren().add(hourglassLabel);
My Code:
Label hourglass = new Label("Hourglass", new ImageView("hourglass.png"));
rootNode.getChildren().add(hourglass);
Is my code okay, or should I write it like the book Writer's code?
|
|
|
|
|
Jonathan Hicks wrote: Is my code okay In respect of what? Does it work or is there some problem?
|
|
|
|
|
In respect to accepted Java coding guidelines.
My code works.
I'm a programmer in another language converting to Java and want to do it right.
|
|
|
|
|
Jonathan Hicks wrote: accepted Java coding guidelines. That is whatever guidelines your company uses.
|
|
|
|
|
The essential difference is that you will have no way to subsequently access the author's hourglassIV . Whether that matters is up to you. Oh, and your code may be harder to debug.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
connentivity problem with postgresql9.4
|
|
|
|
|
|
how write in file (.xls) without delete the older data
HSSFWorkbook wb = new HSSFWorkbook();
HSSFSheet sheet = wb.createSheet("ma feuille");
HSSFRow row = sheet.createRow(0);
HSSFCell cell = null;
cell = row.createCell((short) 0);
cell.setCellValue(1234);
sheet.addMergedRegion(new Region(0,(short)0,0,(short)3));
FileOutputStream fileOut;
try {
fileOut = new FileOutputStream("monfichier.xls");
wb.write(fileOut);
fileOut.close();
} catch (FileNotFoundException e) {
e.printStackTrace();}
|
|
|
|
|
You are creating a new workbook and worksheet, so there is no existing data.
|
|
|
|
|
Hello to everyone
I am developing a simple chat application in java. It has two parts Server.java and Client.java. When I run these files on a local network they work fine but when I run them on PCs that are on different networks it does not works. Can anyone please guide me how to do it.
Thanks
|
|
|
|
|
If you want someone to help you fix your code, then you need to share the relevant parts of your code.
We can't access your computer, see your screen, or read your mind. If you don't show us what you've done, we can't tell you what the problem is.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
It is a networking related problem (configuration, routing, and/or filtering) and not a Java related problem.
The system running the server code must allow incoming traffic to the used port. So you have to configure the firewall settings of your server system and related routers.
When your server system does not have a public IP address (e.g. with a dial-up internet connection) you have to configure also some kind of port forwarding on the router and use a dynamic DNS service.
|
|
|
|