32,204 Topics
| |
Hello I have Java application that runs under unix and has console for user imput. I would like to perform something like this - If I enter "edit config" I would like to vi pop up with config file loaded (with java still running in background" and after user is … | |
code above would print first month correct. but from the second month days or not in order.[code]import java.io.*; public class calendertest { public static void main(String[] args) { int months=12; int days=0; int i=0; for(months=1;months<=12;months++) { System.out.println("----------------------"); if(months%2==1) { for(days=0;days<=31;days++) { if (days%7==1) System.out.println("sunday-"+days); else if(days%7==2) System.out.println("monday-"+days); else if(days%7==3) System.out.println("tuesday-"+days); … | |
I would like to know how i can replace an outputline with a write to a log file? Ive tried searching but no luck. | |
Hai, Am using client server applcation, server is in remote machine, while retreving data from client to server , it takes time, for this i want to show the progressbar in between retrieveing time, how can i do this. please help me for this problem. | |
In my program to implement huffman algorithm.I have created the huffman codes and stored the ascii values and corresponding codes in a map.While creating the encoded file I followed this approach:I firstly converted the ascii codes in to their corresponding integer values and wrote them in a file.Now ,while decoding … | |
[CODE] import java.text.NumberFormat; import java.util.Locale; import java.util.Scanner; class Television { private String itemNumber; private String productName; private double unitPrice; private double unitPrice; //constructor public Television (String itemNumber, String productName, double units, double unitPrice) { setItemNumber(itemNumber); setProductName(productName); setUnitPrice(unitPrice); } //accessor methods for class variables public String getItemNumber () { return itemNumber; … | |
| Hi all I'm new and I'm horrible at Java. I've written this decryption code for a Caesar cipher but now I need to decrypt a one-time pad. Is there any way to simply work with what I have and rewrite it to work with a one-time pad? Or must I … |
I am trying to sense multiple keys at a time and I am wondering how to use a hash map to do this. | |
Hi, I am bit stuck here, I have to have edit this code so that a train must wait in front of the tunnel lock for a train to come in the opposite direction to exit before it can enter the tunnel, i have to use java built in synchronisation … | |
I got an image called badguy and it will not draw in the applet. Here is my code below. [CODE]package mainpackage; import java.applet.Applet; import java.applet.AudioClip; import java.awt.Graphics; import java.awt.Image; public class Test3 extends Applet implements Runnable{ /** * */ private static final long serialVersionUID = 1L; AudioClip shot; Image badguy; … | |
Hi! I am a .NET developer. I have added a Java WSDL as a web reference to an application. After someday I deleted the reference and added it again. From that day I am unable to build/debug/deploy the solution. I am getting the following error: [B]Custom tool error: Unable to … | |
hi guys actually i been searching the net for the past days on how to put a background /and or image in apache-tomcat-6.0.29 can you check if something is wrong with my code? i mean if i wanted to put something like .jpg where should i put it in my … | |
Hello, I am a beginner to java and needed some assistance...I am writing code to create my own singly linked list, and an iterator that iterates over the elements of the list...however I don't know how to use the iterator to display the elements of the list and I am … | |
hi i want to add Scroll Pane to JTable [CODE]JScrollPane jScrollPane = new JScrollPane(table); jScrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); jScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); add(jScrollPane,BorderLayout.CENTER);[/CODE] in the above code table is and Object of JTable with default model i write above code but that code display the scrollbar but they dont work | |
Reviewed with answer from my quiz, I want to make sure that I understand it right? If not, what is yours? int x=1; int j; for(j=0; j<=2; j++) x=x*j; System.out.print(x); --------------------- answer is x=0 My understanding is since this for loop has no curly bracket, therefore, no loop after the … | |
This game is like the game scramble that you play on facebook. Also similar to boggle. Basically you input the dimension of the grid of letters that you want and the dictionary.txt file and it will print you all the words found. It's suppose to find words in all directions … | |
I want to learn how to connect computers so I created a game for 2 players that was played on the same computer, now I want it to be played on a network. I have been trying to do this with sockets. I have a server class: [CODE]public class WordsGameServer … | |
Hi guys, I have a class (DrawPanel) which extends Jpanel.This class generates random shapes (lines,recangles and ovals) . I am suppose to add a statusbar to this class but I can't add even a simple lable to this panel... I am so frustrated and would be so appreciate if anyone … | |
when I try to run a java program on my mac or linux box with the <code> java -version:1.6+ -jar jdesigner.jar </code> it tells me there is no jre found meeting the requirements even though when I type <code> java -version </code> it tells me the version is 1.6.0_20 or … | |
Hello Members, The following code compiles and runs accurately, but gives the following message: [CODE]Note: List.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.[/CODE] [CODE]import java.util.*; public class List { private final static int[] array = {1,2,3,4,5,6,7,8,9,10,11,12,56}; public static void main(String args []) { ArrayList x = … | |
my problem is i cant get the overall numeric score and the grade letter import java.io.*; import java.util.Scanner; public class GradePrg { BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in)); int quiz1, quiz2, quiz3; float tMidTerm, tFinal, tQuiz; int midTermExam = 0; int finalExam = 0; float finalScore= 0; String name; char … | |
I spent so much time from scratch to finish and to the point that I couldn't figured out what is all my mistakes about. I need a fresh set of eye, may you help? (errors at the bottom, sorry for have to scroll down the long page) Thanx [code]/* *Description: … | |
Hello everyone on Daniweb!:) I'm all new with working with swing and I'm having some problems making my paint method work:/. Atm I'm just tryin to make it write a ball, which I can control into different directions. Right now there is quite alot of unnecessary stuff in my code … | |
I get this error and i don't know what is wrong i declared a new class and initialized it yet the compiler still gives me the error above. public class Vec { private double[] v; public Vec(int length) { double[] v= new double[length]; for(int i=0;i<length;i++) { v[i] = 0.0;} } … | |
can anyone say how to use java in windows 7 I installed it but its not working. i am unable to compile a java program. please help me in solving this problem. i am getting this message in command problem when i use javac "'javac' is not recognized as an … | |
I'm creating a silly game, and the first thing I want to make is to tell you "You Lose" if the all that you control with the mouse is not inside the frame. I created a JComponent and every 20 milliseconds it is repainted (A thread does that). Inside it, … | |
This code has gven me more problems than it is probably worth. Can anyone help me please? [CODE]package payrollprogram2; import java.util.Scanner; public class PayrollProgram2 { //begin class public static void main(String[] args) { //begin main System.out.println("Welcome to the Payroll Program"); //output Welcome to the Payroll Program Scanner input = new … | |
peace be upon with you I have a problem i wanna a pseudo code for edge assembly recombination(crossover) . I searched for long time and I couldn't find any good paper satisfy my need. plz if you have a clear one don't hesitate contact me or post the link thanks … | |
How to start building mobile appliacations using J2ME platform.Can somebody suggest me any book for beginners from where I can start learning about it? |
The End.