32,199 Topics
| |
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 … | |
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 … | |
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. | |
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 … | |
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 … | |
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 … | |
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. | |
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 … | |
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 … | |
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 … | |
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 … | |
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. | |
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 … | |
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] … | |
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; … | |
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... | |
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 … | |
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 … | |
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 = … | |
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 … | |
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 … | |
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? | |
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 … | |
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 … | |
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. … | |
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 … | |
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 … | |
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 … | |
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 … | |
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, |
The End.