Gary Hill

Greenhorn
+ Follow
since Nov 06, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Gary Hill

Hi Kurt.

Yes looking at the code i can see what you mean. I didn't write this code, thats why i didn't notice it.

Thanks for your help

Regards


Gary
13 years ago
Hi

Tried to find the problem myself and found if i comment out a line "shown as THIS LINE IS THE PROBLEM, below" the program runs correctly using javaw.exe.

The line i assume means there is a problem and it shuts down the java vm ?

How can i trap this fault so that i can see the fault without using the console window?

Thanks for your help.

Regards

Gary




13 years ago
Hi Jesper,

I tried the command:

%windir%\system32\javaw.exe -jar "C:\Documents and Settings\GB\My Documents\NetBeansProjects\GUI & Comms\RXTX_Serial_Event_Based\dist\RXTX_Serial_Event_Based.jar" > output.txt

and Robs suggestion:

%windir%\system32\javaw.exe -jar "C:\Documents and Settings\GB\My Documents\NetBeansProjects\GUI & Comms\RXTX_Serial_Event_Based\dist\RXTX_Serial_Event_Based.jar" 2>&1 output.txt

But no file was produced even if i tried it with the working link:
ndir%\system32\java.exe -jar "C:\Documents and Settings\GB\My Documents\NetBeansProjects\GUI & Comms\RXTX_Serial_Event_Based\dist\RXTX_Serial_Event_Based.jar" > output.txt



I have sinced edited out the Serial Port so that its no longer used, and purely sent out a simple text message to the console. Now the window is shown correctly without the console window.

Am i correct in thinking that its the Serial Port that is giving me the problem and its not the console window thats the problem?

Somehow the original line:
%windir%\system32\java.exe -jar "C:\Documents and Settings\GB\My Documents\NetBeansProjects\GUI & Comms\RXTX_Serial_Event_Based\dist\RXTX_Serial_Event_Based.jar"

does find the serial port? and the other lines don't?

Regards

Gary

13 years ago
Hi

Ireneusz

Yes it is a Swing GUI and my application does show information on the console screen, but its only for showing variables and also that the Serial Port is working = (cannot turn this part off, as i didn't write this think its in the DLL)

How would i show the GUI without the console screen showing up, as i said, the info its showing is only for diagnostics so not required in the finished application.

Regards

Gary





13 years ago
Hi

I want my application to show on screen without the "command prompt" screen showing.

Have been trying to find out why this doesn't work.

I have created a application in netbeans and "clean and build" it.

I have then created a shortcut from the desktop to the jar file.

If i use: (This doesn't work. All that happens is the application flashes on the screen for less than a second)
%windir%\system32\javaw.exe -jar "C:\Documents and Settings\GB\My Documents\NetBeansProjects\GUI & Comms\RXTX_Serial_Event_Based\dist\RXTX_Serial_Event_Based.jar"

If i use: (This does work)
%windir%\system32\java.exe -jar "C:\Documents and Settings\GB\My Documents\NetBeansProjects\GUI & Comms\RXTX_Serial_Event_Based\dist\RXTX_Serial_Event_Based.jar"

The javaw.exe is in the system32 folder.

My application does use the Serial Port of the PC to get data, if i remove this function then the javaw.exe does work correctly?

Any help would be appreciated as I have spent 4 hours trying to work out what is wrong.

Regards

Gary

13 years ago
Hi Rob,

Yes thanks for pointing that out.

Regards

Gary
13 years ago
Hi Rob,

Thanks is now working.. and for any one else that reads this here is the working main code.

Regards


Gary



13 years ago
Hi,

Using Netbeans:

I am trying to get a GUI window to look correct on windows XP at the moment it is using "Metal" as its default window.

I have searched on the internet and found code thats supposed to change it but it doesn't work ?

If you could assist me i would be grateful.

Regards

Gary





13 years ago
Thanks J Insi and Tom

That has solved my problem!

Its obvious now

Regards


Gary
13 years ago
Hi,

I am new so may have some terminology wrong!

I am trying to access a method from my main class, i have created an object and i can access this method from Main.

But if i then try and access it from another method it cannot be seen and i cannot compile my code.

In public void test() the compiler says "variable Window cannot be found". Obviously this is not supposed to be a variable!
It also has a thin red squigly line under Window (as its an error in Netbeans)

I have stripped the code down to the minimum for clarity on here.

I would appreciatte some help. Thanks

Regards


Gary



Please see code below:





13 years ago
Hi Steve,

Thanks for your reply, as this is my 1st Java project, the 2nd choice is hard to understand at the moment.

I tried the 1st one and did get it to print to the console the contents of buffer from my Main Class.

But then tried to print it to my jTextArea from my main method, but because its in a different method it couldn't find the symbol variable "buffer"
Which is what you said would happen, i think?

Regards

Gary

13 years ago
Hi

I have tried for hours and hours to work this out as well as scanning the internet, but still am no closer as to how to do this?

Briefly the code receives data from the Serial Port on a PC (this i have working)

Eventually this data gets stored in = buffer.

I wish to use this data in another class to be sent to a jTextField (i think i know how to do this)

But do not know how to get the buffer data back to my main class ? (for testing purposes and to check it works)

The part i require help on is in "public static class SerialReader implements Runnable" and marked
>>>>>>>>>>>>>>>>>>>>>>> HOW TO RETURN THIS BUFFER TO MAIN? <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

I have commented the code a lot so should help.

Thanks if you can help!

Regards Gary









13 years ago
Thank you,

Pete and Campbell for making me feel welcome!

I know I will have a lot of questions which i iwll try and find answers for before asking on here.

I do find Java a hard thing to learn, i have dabbled in VB.Net but i do beleive that Java is the way to go!

Regards

Gary
13 years ago
Hi Pete

You were right, in simplifying the code to display on here i realised that a few days ago, I had set up a method to set the windows look and feel in Java. And in my Class Main i declared

NewJFrame LookandFeel = new NewJFrame(); // Sets up the Object.
LookandFeel.setVisible(true); // turns on JFrame.

Then few days later started to right more code and forgot about the above, as soon as I changed the code to:

LookandFeel.textData("gb");

It works perfectly !!!

Thank you for your help and patience.


Regards

Gary
13 years ago
Hi,

I have looked verywhere on the net but cannot find an anser to my simple problem.

I wish to send text to a jTextArea the jTextArea is in a class called public class NewJFrame.

From another class Main i want to send text.






If i uncomment //name= ("gb"); i can then see the correct text in the jTextArea.

If i send it from Main as shown above it doesn't show the text?

The println shows me that the method has received the string.


I have been trying for hours to work out why its not working but i cannot find out what is wrong!

Can you please help i know its easy but as i'm still learning it isn't easy fro me.

Regards


Gary
13 years ago