|
Not sure if this will work, but maybe it will give you a palce to start.
try using methods setAlignmentX() and setAlignmentY(). Increment them in the direction you want your text banner object to move.
John P.
|
|
|
|
|
Does anyone have any walkthrough's for creating your own IP discovery protocol? Basically to write my own ARP protocol. I would like to send a MAC address broadcast to the nodes in the local subnet and read through the responses they give me which contain their IP address. (Preferably without any requirement for special software on the listeners end).
|
|
|
|
|
All you have to do is run the application and send me a screen shot of the application running.
You can download the application from the following web page, it is called "Ripserver Finder"
http://www.ripfactory.com/ripserverdownloads.html
This is an application that I have created to detect a particular device on a LAN by searching for a preset hostname.
Any help with this is greatly appreciated.
My Email address: micealg@yahoo.co.uk
- M
When the game is over the Pawn and the King go into the same box.
|
|
|
|
|
I'm beginning with java and I'm using NetBeans IDE 6.1 to edit, build and run my first sourcefiles and projects.
The problems is when I need to enter data to my program. For example, look at the following code:
package formattedprint;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Enter an integer number:\n");
int intNum = in.nextInt();
System.out.println("Enter a string:\n");
String string = in.nextLine();
System.out.println("------------------------------");
System.out.printf("Integer number: %d%n", intNum);
System.out.printf("Cadena: %s%n", string);
System.out.println("------------------------------");
}
}
When I run this code, there is not an input window. Only I can enter data in the "output window", and it seems to work in a bad way:
When the program ask for the integer number and I enter 1 (for example), the program finish without ask for the string.
This is the output window:
init:
deps-jar:
Compiling 1 source file to /home/adrian/NetBeansProjects/FormattedPrint/build/classes
compile:
run:
Enter an integer number:
Enter a string:
------------------------------
Integer number: 1
Cadena:
------------------------------
1
BUILD SUCCESSFUL (total time: 6 seconds)
I think, I'm doing something wrong. (May be I should open an input window, but I didn't find it.)
Please, can somebody help me?
[Adrián Córdoba]
|
|
|
|
|
Hi,
yep that was kinda weird or was just done for file reading. :S
btw i dunno why are you using printf if you have the easier methods which are println and print :P
however its ur decision but i find this is working XD
anyways you can use this code:
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Enter an integer number:\n");
int intNum = in.nextInt();
System.out.println("Enter a string:\n");
//This will only read the first string aka the first name if u wish
String string1 = in.next();
//This is for the last name if you wish
String string2 = in.next();
System.out.println("------------------------------");
System.out.println("Integer number: " + intNum);
System.out.println("Cadena: " + string1 + " " + string2);
System.out.println("------------------------------");
}
}
The output:
init:
deps-jar:
compile:
run:
Enter an integer number:
1
Enter a string:
Jassim Makki
------------------------------
Integer number: 1
Cadena: Jassim Makki
------------------------------
BUILD SUCCESSFUL (total time: 6 seconds)
BlaCk WolViX
|
|
|
|
|
Thank you. I'll try your recommendations.
P.S.: I was using printf method because it was recommended in the practice of the book I studying with (Core Java 2).
[Adrián Córdoba]
|
|
|
|
|
no problemo anytime buddy
BlaCk WolViX
|
|
|
|
|
Hi i have been searching the internet for days and couldn't find the answer .. so please bear with me
anyways i have been trying to solve this question .. the question goes as follow:
Q: Write a program that fills the component with a large ellipse, filled with your favorite color that touches the window boundaries. The ellipse should resize itself when you resize the window.
Guys all i wanna know is how to make it touch the boundaries and how to make it resize itself.
Thank you.
modified on Tuesday, July 22, 2008 3:46 PM
|
|
|
|
|
how to make it touch the window ?
easy
draw it of the size of the component, and be sure the component is of the size of the window (in your window, add a panel, on which you can draw directly)...
if you place the drawing code in the correct event handler, (overload paintComponent(Graphics)).
|
|
|
|
|
|
Do i need an Apache/Tomcat server for a code program that needs the client to establish connection with the server & depending on what user does thereafter ,it updates the desktop of the client periodically i.e sends new desktop images to the client...now am i in need of an Apache/Tomcat server installation, if i want to run this code from the same system ....
I somehow can't test it on a n/w.....
|
|
|
|
|
Hello Everybody,
Can anyone help me to implement ECDh in Java? I need it so much.
Thanks
Nayeem
|
|
|
|
|
|
I have a string strValue = " 'one',two "
I want to change the the value strValue to " 'one'+'two' "
Can anybody help me?
Jo
|
|
|
|
|
according to documentation [^]
strValue = strValue.replace(',','+');
should do the trick.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
create a class toy collection that stores information about different toys in a toy shop. The information to be stored about a single toy is,
- toy identification as string
- name of the toy as string
- Short discription about the toy as string
- Price of the toy as float
- Quantity of the toy in hand as short integer
This class contains following methods,
- Constructor method that assigns user input values to above mantioned variables.
- main() method that creates array of 4 objects of toycollection class and that takes input for all about details from the user end
class method to check validity of Quantity and Price values. If all values are valid then create the object and display the details for all 4 toys.
- Method that checks validity of quentity and price. If the quentity is 0 or negitive then method should through a user defined exception with approriate message and come out of program. Similiry if the prize is 0 or negivity then it should through user defined exception with appropriate message and come out of the program.
- Method that displays all detail about a single toy in the following format, e.g. Here Total price should be calculated
Toy Identification : S-1
Toy Name : Small Scooter
Toy description : Ordenery 3 wheeler Scooter
Toy Price : 650.50
Quantity in hand : 3
Total price of Toys : 1951.50
|
|
|
|
|
So you want us to do your homework, right ?
and what if you were listening at the teacher when he was talking to you guyz at the rear of the classroom ?
|
|
|
|
|
i m having problrm in running java program.My program is getting compiled but when i try to run it it give me the following eror
Exception in thread "main" java.lang.NoClassDefFoundError: Example
The name of class in my prog.is Example
i m compiling it using javac Example.java command and running it by using java Example bt it is generating error.plz help to fix my problem.
annie
|
|
|
|
|
such an exception typically occurs when a user-defined class you're using (a class of yours then) cannot be found by the JVM.
To solve that, check your classpath.
Just a guess : why don't you use an IDE (Eclipse is pretty cool for java !! you should have a look at it) ?
BTW, Do you Example class references any other class defined in another file which the compiler wouldn't know about ?
|
|
|
|
|
My guess is '.' would be missing in the classpath.
As in aforesaid reply, its good to use IDE like Eclipse.
|
|
|
|
|
Hello,
I've only dabled a bit in Java, I work almost exclusively with .Net. That being said, I am looking to do encrypt a string from a java application (this will be done by another developer), decrypt it in .Net and send an XML response to the the java app.
Is there a universal method for encryption in Java that would allow us to use the same encryption key/method?
I know how to encrypt/decrypt in .Net, I just need to know if there is a standard that is used by both frameworks?
|
|
|
|
|
FYI - (in case anyone is interested)
I just used standard DES encryption which worked out great for my situation. As long as the same rgb/rgbIV keys are used on both ends, the entire process was very painless.
|
|
|
|
|
if we have a tree that contains int.
I want to find the largest subtree, in a sense that it (subtree)has largest sum of the values of the nodes
Any idea, codes??
Thanks
P.S.
|
|
|
|
|
I think you need to clarify your question. E.g:
1. Are you talking binary trees here?
2. Do you mean you want a method to test which childnode of a given node that together with its childnodes has the largest sum of values?
"God doesn't play dice" - Albert Einstein
"God not only plays dice, He sometimes throws the dices where they cannot be seen" - Niels Bohr
|
|
|
|
|
Please help me in reading large files in java.i encountered OutofMemoryError.
buntyrolln
|
|
|
|