32,199 Topics

Member Avatar for
Member Avatar for smoore

Okay so I found some code online to create a simple chat server and I was trying to teach myself with it. I have a few questions though. First off here is the code: [B]ChatServer.java[/B] [CODE] import java.io.IOException; import java.net.InetAddress; import java.net.Socket; import java.net.ServerSocket; import java.net.UnknownHostException; import java.util.Scanner; public class …

Member Avatar for smoore
0
142
Member Avatar for suncica2222

I just inctance 5 JFrames with string drawed and its using 100% ...??? that add(panel); make the diference in CPU 5 or 100% I marked it in the comment in the code here's the code: [CODE]//import java.awt.event.WindowEvent; //import java.awt.event.WindowListener; import java.awt.*; //import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.event.*; import …

Member Avatar for sciwizeh
0
256
Member Avatar for SnagglezMaw

Is there something in Java that will perform the + or - operation? I need to compare a couple variables but the variables are not going to be exact, they'll be off by about +or- 2.

Member Avatar for peter_budo
0
109
Member Avatar for localp

1.) I want to stream Live Audio, and i have chosen JMF to do it, i am an absolute beginner to JMF, so can anyone help me by providing me with some easy to understand Source codes of a Live audio/video program, so that i could go through it and …

Member Avatar for saini.amit007
0
112
Member Avatar for sciwizeh

Hello all, it's been a while since I've had a question, but I'm back. I'm trying to write a Vector class which can be any type. The problem I have is that generics can only hold objects, so when I try to say x+=vec.x it says that it cannot do …

Member Avatar for sciwizeh
0
135
Member Avatar for kartheepanmirra

Hi i am working swing based applet application which is deployed on a [B]jboss3.2.6[/B] webserver.the jar file [B]application.jar[/B] size is 140kb.i compressed the jar file using sun java pack200 technology as [B]application.pack200.gz[/B] file.now the jar file size is 46kb.the jar is deployed on application.war file with context-path [B]/application[/B] on the …

0
77
Member Avatar for Xessa

In my textArea the strings ' and " are passed to my Java method as unicodes. So instead of ' what i see is ’ What can i do to prevent this because it is also updated in the database as its unicode representetive.

Member Avatar for JamesCherrill
0
69
Member Avatar for brandongood

Im working on a program that requires you to create an array with 10 elements, and asks the user to enter values for each array. Then, you need to copy the contents of the first array into another array, in reverse order. Can someone walk me through this one? Im …

Member Avatar for brandongood
0
91
Member Avatar for puneetkay

Hello, I just discovered that we can use unicode anywhere in the program. EG :[CODE=java] public class CheckUnicode { public static void m\u0061in(String\u005B\u005D args) { System.out.println("Hello World!"); } } [/CODE] \u0061 = 'a' .. \u005B = '[' .. \u005D = ']' This program will execute fine without any errors. But …

Member Avatar for puneetkay
0
165
Member Avatar for brandongood

Ok, I have to write a code snippet that prints out the value of 2 to the powers of 1 – 31 in a 10 character width, right-justified column. You may not use any literals or Math methods. Seeing as Im not allowed to use Math.pow, the only other option …

Member Avatar for brandongood
0
85
Member Avatar for suncica2222

I need timer that is going to make pause in running of main thread. Like Thread.sleep() does,just I don't want to create Exceptions like this does. So I want to use Timer class. "java.util.Timer;" this one. I want to make class and to use her constructor where I need pause,like …

Member Avatar for JamesCherrill
0
114
Member Avatar for gitech

Hai friends, i want to invoke .net webservice([url]http://www.meizlik.com/Service.asmx[/url]) in java, how can i invoke, pass parameters to get result. please help me for this problem.

Member Avatar for kvprajapati
0
89
Member Avatar for Hockeyfreak889

ok so have been assigned to make a 2 player tic tac toe game for my final project this year in school. However since this is a fisrt year java course we are using like "fake java" just to get the hang of it. Except now i have to work …

Member Avatar for BestJewSinceJC
0
215
Member Avatar for mintsmike

Hello People. I have set up my simple Java GUI to use a JTextPane. I need it to display the following 3 lines over and over again: [LIST=1] [*]A line with input from a variable (aligned left) [*]A line with output from a variable (right aligned) [*]A blank line [/LIST] …

Member Avatar for BestJewSinceJC
0
84
Member Avatar for robbiepoo

I posted before but i had to repost to add the code thing. So heres the program. [CODE] import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.*; import java.awt.Color; import java.awt.Font; public class Testknowledge3 extends JPanel implements ActionListener { //Declare objects JButton Next; JButton Back; JLabel label; ImageIcon icon; JTextArea title; …

Member Avatar for BestJewSinceJC
0
82
Member Avatar for weblover

hi all , how are u? i have a question , i have a java project and i want to check if a fucntion is called or executed while the execution of the program ..how can i do this ?....thnx in advance...

Member Avatar for weblover
0
95
Member Avatar for robbiepoo

Ok so im doing a project for school and i made an array to add up the scores. (the project is a learning module, (game)). So heres my code, i have declared everything in my main program (starting one) called science.java and my two other parts of the game (true …

Member Avatar for masijade
0
84
Member Avatar for dev.mena

if chat room members is 4 and each have mic the server receive the 4 packets and resend it in the same order here more delay in the client to run packet 1 and 2 ..... i want to merge the sound and send it to be in the real …

Member Avatar for JamesCherrill
0
106
Member Avatar for mintsmike

Hello people: I am trying to create a ComponentListener method that will resize some components when the window is resized. I have tried the following code, only to find out that it didnt work: [code] import java.awt.event.*; import java.awt.*; public class PowerEvent { PowerMath gui; PowerEvent(PowerMath in) { gui = …

Member Avatar for mintsmike
0
287
Member Avatar for suncica2222

how can I trigger anything outside the method ??? like carry the boolean a outside [CODE]public void windowClosing(WindowEvent arg0) { System.out.println("Window Closing"); a=true; // cant refer to non final variable a inside an inner class defined in a different method[/CODE] I want to use "a" in while loop for instance …

Member Avatar for suncica2222
0
277
Member Avatar for scream2ice

hi everyone Im working on a program that includes hash tables and files. What i'm doing is that I save the information (Name, Student ID, Address, Phone No.) of some students in a text file. I use a hash table to work on the students' information. Things like showing the …

Member Avatar for JamesCherrill
0
96
Member Avatar for stewie griffin

Hi, I have java code, in the code there is about 5 lines that I wont to open in new Thread, I don't wont to crate all new class for 5 lines , can I can I implement the Thread inside the method without new class?

Member Avatar for stewie griffin
0
101
Member Avatar for mbichichi

Hi I am writing a java program for a mobile database that should input from the user three entries (manufacturer, Model and Rating) save this in an array and file and be able to search from the data i the file and print on screen. I have written it but …

0
33
Member Avatar for wonder_laptop

Hello, can you PLEASE put a SIMPLE traceroute code in java. i googled traceroute but i got a bunch of compicated codes. im new in networking programming, i want to implement the traceroute command . i already managed to create a network and wrote a program for the laptops to …

Member Avatar for huj_v_palto
0
184
Member Avatar for Metahuman

Hi everyone, I am trying to set my own calendar in JAVA. What I mean is, unlike the default Calendar I want to construct my own Calendar where a day will be only 13 hours for example instead of the 24 and there will be 30 days in every month. …

Member Avatar for JamesCherrill
0
93
Member Avatar for Mubo

Hi guys, these days Social Networking Sites are spreeding faster around the world and they getting more users into their networks daily. My question ist. How to implement an algorithm as simple undirected graph in social networking site and how to search and find special groups who know each other …

Member Avatar for JamesCherrill
0
142
Member Avatar for Virux

So, I have an interface I would like to use, and I need to put lines on a JPanel within a Frame. Because I need other controls in the Frame so if I set the frames focus to the lines I won't have the controls. And also, I have another …

Member Avatar for Virux
0
4K
Member Avatar for k2k

i need to use java to generate and write/append (long)numbers to a text file and use those data for calculation later. can anyone give me a quick reference on what i should use? i tried: PrintWriter ---> no writeLong() RandomAccessFile and BufferedWriter --> give me byte code i have been …

Member Avatar for masijade
0
153
Member Avatar for djdanjo82

Hello All! First thanks for viewing this thread. My issue is I have a class below that I want to call and the constructor requires a File variable and I do not understand how to declare this so I can call it from my main class. My last issue is …

Member Avatar for javaAddict
0
140
Member Avatar for jackiejoe

I have two elements that I have in a List Object, but am trying to compare these elements and if they are the same return true otherwise false. But am unsure how to get the two items from the list and compare? Thanks,

Member Avatar for javaAddict
0
531

The End.