|
we don't do homeworks here.
Read the guidelines, try to do the work yourself first, and ask for specific question only when you're stuck on something.
If you cannot do anything at all, then you're not the one for the job...
|
|
|
|
|
Hello,
I am developing an application which uses mysql database. The database will be located on one of the system on the lan.
I need that i enter the ip address of the system on which database is located and it should connect to the database.
Thanks
Vinod Maurya
|
|
|
|
|
hi everybody
i am a .net developer and i start to use java with spring.
i want to load a xml file in File object at this way :
File f = new File("D:/MyProjects/Sun Java/MyClinic/src/Clinic/Core/ApplicationContext.xml");
and in netbeans debug mode when compiler wants to process this line encourge pause and next line not processed
say something usefull about relative path in java.
please forgive me for my bad english skill.
thanks all.
---------------------
Areff Bahrami(KAVEH)
Areff.HB@Gmail.com
---------------------
|
|
|
|
|
Enclose that line in a try{}catch(){} block and see if there is an error being generated.
Don't let my name fool you. That's my job.
|
|
|
|
|
I hope someone can help me out here. I am not that familiar with JS and I found this script online which I modified, but I can not control how to open the links. All the links open in the same window but I have some external links that I have to open in a new window.
Here is an example of what I have:
bar.addMenu('Insulated Glass');
bar.addItem('http://www.associatedmaterials.net/Docs/glass_specs/Units.pdf','IG Quality');
I would appreciate any help.
|
|
|
|
|
Please do a Google search for Javascript.
As far as anchor tag attributes, you want "target=_blank". The anchor tag [<a...>~</a>] is not Javascript, but HTML.
Don't let my name fool you. That's my job.
|
|
|
|
|
how can i connect items list at j2me to required form
i need the code that make it
necessaryyyyyyyyyy
|
|
|
|
|
Is this[^] helpful?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hi all
I want to start Mobile (Cell Phone) Programming with java (those *.Jar files)
But i don't know from where i should start.! Could anyone give me some start point...Article,E-book,...
Thanks in advance.
Kind Regards.
|
|
|
|
|
Hi i need peer-to-peer voice chat project on java.
can any one post that for me.
|
|
|
|
|
You need to goto www.rentacoder.com for that. Or with such a simple app, you could even just Google it.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
Dear All,
I am looking for a good IDE similar to eclipse.
Any ideas ?!?!
Regards,
Muhammad Nauman
"Mess with the Best, Die like the rest"
|
|
|
|
|
What exactly is wrong with Eclipse? There are plenty other out there, but I couldn't begin to suggest without knowing what is wrong with the one you use now. I prefer Eclipse myself anyway.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|
|
There is nothing wrong with it, but somehow the other my machine seems to be dead once eclipse has started.
I was just thinking trying out another ide
"Mess with the Best, Die like the rest"
|
|
|
|
|
You could always try the one that Sun provides if you download the right Java bundle. I believe they call it Netbeans. (http://www.netbeans.org/downloads/index.html[^])
I've played with it, but I prefer to use Eclipse myself.
Don't let my name fool you. That's my job.
|
|
|
|
|
I cannot advise better than the other answer you got. to me, Eclipse is the best IDE for Java/J2EE I know...
|
|
|
|
|
Hello! I need to make some search in the registry...
I need to find all the keys and the values that include some word, and to
delete them... I know there is a class Registry, but I don't know how to
do what I need.
Maybe someone could help me? (in Java)
if someone could show me an example code it will be great!!!
Thanks!
Raz.
|
|
|
|
|
need help in writng a class WordStore in order to compile WordTest1, WordTest2, WordTest3 and WordTest4. Need to create some sort of data structure to store words in WordStore. must have methods
public void add(String word)
Adds a String to the collection
public int count(String word)
Returns the number of times a String is in the collection
public void remove(String word)
Removes one occurrence of a String from the collection, or leaves the collection unchanged if the String does not occur in it.
code for WordTest1:
import java.util.Scanner;
class WordTest1
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
WordGen.initialise(input);
System.out.print("Enter the number of words you wish to generate: ");
int n = input.nextInt();
WordStore words = new WordStore(n);
for(int i=0; i<n;> words.add(WordGen.make());
String line = input.nextLine();
System.out.println("Enter words to test, empty line to exit");
line = input.nextLine();
while(!line.equals(""))
{
String[] wordlist = line.split(" ");
for(int i=0; i<wordlist.length;> {
int count = words.count(wordlist[i]);
System.out.print("\""+wordlist[i]+"\" ");
if(count==0)
System.out.println("NOT generated");
else if(count==1)
System.out.println("generated once");
else
System.out.println("generated "+count+" times ");
}
line = input.nextLine();
}
}
}
code for WordTest2:
import java.util.*;
class WordTest2
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
WordGen.initialise(input);
System.out.print("Enter the number of words you wish to generate initially: ");
int n = input.nextInt();
WordStore words = new WordStore(n);
for(int i=0; i<n;> words.add(WordGen.make());
System.out.print("Enter number of words you wish to test: ");
n = input.nextInt();
String[] testWords = new String[n];
for(int i=0; i<n;> testWords[i]=WordGen.make();
long time1,time2;
int count;
time1 = new Date().getTime();
for(int i=0; i<n;> count=words.count(testWords[i]);
time2 = new Date().getTime();
System.out.print("Time taken to test membership of "+n+" words ");
System.out.println("is "+(time2-time1)+"ms");
}
}
code for WordTest3:
import java.util.*;
class WordTest3
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
WordGen.initialise(input);
System.out.print("Enter the number of words you wish to generate initially: ");
int n = input.nextInt();
WordStore words = new WordStore(n);
for(int i=0; i<n;> words.add(WordGen.make());
System.out.print("Enter number of words you wish to add: ");
n = input.nextInt();
String[] testWords = new String[n];
for(int i=0; i<n;> testWords[i]=WordGen.make();
long time1,time2;
int count;
time1 = new Date().getTime();
for(int i=0; i<n;> words.add(testWords[i]);
time2 = new Date().getTime();
System.out.print("Time taken to add "+n+" more words ");
System.out.println("is "+(time2-time1)+"ms");
}
}
code for WordTest4:
import java.util.*;
class WordTest3
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);
WordGen.initialise(input);
System.out.print("Enter the number of words you wish to generate initially: ");
int n = input.nextInt();
WordStore words = new WordStore(n);
for(int i=0; i<n;> words.add(WordGen.make());
System.out.print("Enter number of words you wish to add: ");
n = input.nextInt();
String[] testWords = new String[n];
for(int i=0; i<n;> testWords[i]=WordGen.make();
long time1,time2;
int count;
time1 = new Date().getTime();
for(int i=0; i<n;> words.add(testWords[i]);
time2 = new Date().getTime();
System.out.print("Time taken to add "+n+" more words ");
System.out.println("is "+(time2-time1)+"ms");
}
}
|
|
|
|
|
hi
my problem is that im trying to build a one armed bandit using Java but i carnt figure out the If statement that lets you get:-
3 shapes of the same type win £1
2 shapes of the same type win 50p
one particular shape, say a apple win 20p
my coding that i have already should be below
any help with this problem would be great
thanks
Adam
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.Timer;
public class ConcentricCirclesWithTimer extends JFrame implements ActionListener
{
private JPanel panelDraw;
private JButton btnDraw, btnBye;
private Random random;
private Timer timer;
int width = 10;
int height = 10;
int x= 100;
int y = 100;
int timerCounter = 0;
public static void main(String[] args)
{
ConcentricCirclesWithTimer drawConcentCirc = new
ConcentricCirclesWithTimer();
}
public ConcentricCirclesWithTimer()
{
setLayout(new FlowLayout());
random = new Random();
panelDraw = new JPanel();
panelDraw.setPreferredSize(new Dimension(200, 200));
panelDraw.setBackground(Color.GRAY);
btnBye = new JButton("Bye!!");
btnDraw = new JButton("Draw.. .");
add(panelDraw); add(btnDraw); add(btnBye);
btnDraw.addActionListener(this);
btnBye.addActionListener(this);
setTitle("Using Pannel to Draw . . . .");
setSize(300, 300);
setVisible(true);
}
public void actionPerformed(ActionEvent event){
if (event.getSource()== btnDraw) {
timer = new Timer(400, this);
timer.start();
}// end of if
if (event.getSource() == timer ){
drawConcentricCircles() ;
}
if (event.getSource()== btnBye) {
System.exit(0);
}
}// end of actionPerformed
private void drawConcentricCircles(){
// x, y, height and width need to be declared globally?? Why??
// declare them here and run program!!
timerCounter = timerCounter + 1;
Graphics drawOnPanel = panelDraw.getGraphics();
drawOnPanel.setColor(new Color(random.nextInt(255),
random.nextInt(255), random.nextInt(255)));
drawOnPanel.drawOval(x, y, width, height);
width = width+20;
height = height+20;
x = x - 10;
y = y-10;
if (timerCounter>11){
timer.stop();
JOptionPane.showMessageDialog(null,"Timer stopped!!");
}
}
}
|
|
|
|
|
I assume this is a standard 3-wheel slot machine?
You should have a "slot" object defined somewhere, or at least some member variables to hold the "shape" and "color" values of each slot wheel.
The "if" statements aren't writable until we know what to compare them with.
For example, would it be "if (slot1Color == 0)" or "if (slot1.color == Color.RED)" or something else?
All you have written is a skeleton application. None of that concerns the question you wanted help with.
Don't let my name fool you. That's my job.
|
|
|
|
|
hi,
I had developed a chat application it is running well on a single system.I want this chat appl. to be communicated with other system like normal chatting. Plz help me out vth this issue.
thank u.
|
|
|
|
|
How You developed the Code?Is it developed by JAVA Threading?
Please let me know the code so that i can give you the exact way to do it.
thanks
Apurba
|
|
|
|
|
hi apurba,
s i had developed using threading concept.my chatserver is working on a default ip-address .0.0.0.what i want is my chatserver must start by picking up my systems Ip-address.here is the code m using.
protected void start_iChatServer(){
try{
iPortNo=Integer.parseInt(iAcquirePortNo.getText());
System.out.println("Port No." + iPortNo +"/n");
}catch(NumberFormatException e){
System.out.println("\n"+e);
System.out.println("Starting at default port : 1664...");
iPortNo=1664;
}
try{
iChatServer=new ServerSocket(iPortNo);
Int=iChatServer.getInetAddress();
i=iChatServer.getLocalPort();
sad=iChatServer.getLocalSocketAddress();
System.out.println("inetaddress=" + Int+ "localport="+i+ "getlocalsocketaddress="+sad);
isServerRunning=true;
System.out.println("\nServer set up and running at port "+iPortNo+"...\nWelcome to iChat Server v1.0...");
System.out.println("ichatserver=" +iChatServer);
iAcquirePortNo.setEnabled(false);
srtServer.setEnabled(false);
stpServer.setEnabled(true);
iClientList=new ArrayList();
iMainThread=new Thread(this,"iChat Server v1.0");
iMainThread.start();
}catch(IOException e){
System.out.println("\n"+e);
System.out.println("Error occured while setting up the server...\nTry another port...");
}
}
public void run(){
while(iMainThread!=null){
try{
Socket iNewClient=iChatServer.accept();
InfiniteChatClientHandler iNewClientHandle=new InfiniteChatClientHandler(this,iNewClient);
Thread.sleep(1000);
}catch(InterruptedException e){
}catch(IOException e){
}
}
}
Thank u
have a nice day.
|
|
|
|
|
I have 5 java classes and I want make them an executable one.
I use Netbeans IDE.
|
|
|
|
|
With Java you create JARs instead. Google that phrase and that should help. I think there are ways to turn Java apps into .exe files, but I have never done it, and that completely destroys most pros of Java.
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo
|
|
|
|