35,618 Topics
![]() | |
I need to do a pretty standard dining philosophers setup for my class. (I assume most people on here know what this problem is... if not look here: [url]http://en.wikipedia.org/wiki/Dining_philosophers_problem[/url]) We need to have a variable number of philosophers between 2 and 8, and avoid deadlock and starvation. In my design, … | |
I am creating a game in which I import images from files to represent characters, etc. I have created a class called Contents which represents anything that can be placed on a tile of the gameboard. A subclass of Contents (by several levels) is Wizard, to create a wizard character. … | |
When a user Scans a barcode representing a # sign while focus is on the fromComboBox, code is used to scroll through the list. It scrolls through the list fine, but then it moves to the next field on the screen, because the scanner (that is what we use for … | |
[CODE]import java.io.*; class DecToHex { public static void main(String[] args) { Console console=System.console(); System.out.println("Please enter a decimal number"); String input; input=console.readLine(); int dec; dec=Integer.parseInt(input); String hex=""; int remainder; String hexChars="0123456789abcdef"; if(dec==0) hex="0"; while(dec!=0) { remainder=dec%16; hex=hexChars.charAt(remainder)+hex; dec/=16; // what does that mean? } System.out.println(hex); } }[/CODE] what does dec/=16 in … | |
hello can you help me i make a program that will determine palindrome words using array...how can i determine if my words are palindrome... example if i input: radar == radar-->this is palindrome so if i input this notice--->this will print not a palindrome please help me here is my … | |
simo1.java [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class simo2 extends JFrame implements ActionListener{ private JRadioButton red; private JRadioButton yellow; private JRadioButton blue; private JRadioButton green; private JRadioButton magenta; public simo2() { setLayout(new FlowLayout()); setVisible(true); setSize(400,250); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); red=new JRadioButton(" red"); yellow=new JRadioButton(" yellow"); blue=new JRadioButton(" blue"); green=new JRadioButton(" green"); magenta=new … | |
I am trying to do a program which does simple maths by scanning using provided three items (two number and an operator) then let the program do the calculatin and printout the result. The way i have attempted it so far (below is the code) the value of the operator … | |
Hey hi all, I am new to jsp,servlets .. i am doing a small project on employee database management. In this I have a form which has various fields. And also buttons for add,delete,update,next and previous. Now what I want is I click on previous it should retreive values from … | |
this code shows the second oval only when maximize is pressed otherwise only the one oval is shown and the first oval does not go to the getHeight() where as the one appearing after maximizing repaints correctly [CODE][/CODE][code]import javax.swing.*; import java.awt.Graphics; class drawpanel extends JComponent implements Runnable { int i=10,startx; … | |
I've recently been programming J2ME apps for Mobiles when it struck to me - something I remembered: "A virus infected my mobile!". I find it strange. Obviously, the regular EXE files don't work on JVM so can no way infect mobile phones. So there should be Java-specific viruses, but J2ME … | |
I'm running MSSQL Server 2008 I did this: set CLASSPATH= C:\Program Files\Microsoft SQL Server JDBC Driver 3.0\sqljdbc_3.0\enu\sqljdbc4.jar (I dont know where I can check if this has been executed correctly) Then when approaching this URL: [url]http://localhost:8983/solr/db/dataimport?command=full-import[/url] Using this data-config.xml: [code=xml]<dataConfig> <dataSource driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" url="jdbc:sqlserver://localhost:1433;databaseName=wedding" user="sa" password="r00kw0rst" /> <document name="weddinglocations"> <entity name="location" … | |
I am interested in Current threads, such as : rare program :s [url]http://www.daniweb.com/forums/thread300723.html[/url] how to create 2D array of enumeration values [url]http://www.daniweb.com/forums/thread300738.html[/url] which have a common goal: to store the names of Enums objects in a 2D array of String. For example, we have a pack of porker cards defined … | |
[B]Why is a null displayed in the first row?[/B]:-/ I want the first row to display the text value given in the textfield(actually i am getting the text value from database) Any help??[code]<html> <head> </head> <body> <form name="form1"> <input type="text" name="txtname"> <input type="submit" value="Click here" name="Click" onclick="fun(this.form)"/> </form> <script> function … | |
Hi all, I've got a problem relating to error reporting. In the code posted below, when the user actually presses enter after reading the error, the program does not loop back to the main menu, but merely repeats the error. If I remove the "input.nextLine();" code in line 17, then … | |
Hi all, I am having a trouble in identifying Java Memory Leakage in my java program.I want to check where the memory lecakage gets occurs.Is any tools are available for the java program to analyze the memory leckage. Thank you, With Regards, Prem | |
I cannot get Java script to work on my windows XP, SP3. Any assistance out there. I have checked the settings for Java and all appear to be in order (ie: tools, internet options, etc. All java settings are set to run. I am stumped. | |
People, this is all my code is. I am trying to change an Integer Object to a primitive int, to use them in the getValue and Compute(Integer i) methods . Compiler Says NO.. I have tried both the solutions below ... and got the following errors i.intValue(); // no method … | |
Hi, I am having issues while comparing of cards.As i starts the card game and clicks on first button the card opens and when i click on the any other button if the button i have clicked matches with the image on the first button both the cards stays open … | |
Below is code taken from [URL="http://download.oracle.com/javase/tutorial/java/javaOO/QandE/enum-answers.html"]Sun Java Tutorial[/URL]. From my reading of the code the first time this loop executes should it not populate cards[1] with the first card skipping cards[0]? I've tested the code in eclipse and it seems to work properly first populating card[0] so I'm hoping somebody … | |
Hi guys, Just a quick question, I'm working on a general stack class for use with my card game and rather than creating an overloaded constructor for every single object and primitive type I'm wondering is there a way to supply the data type when invoking a basic constructor? Basically … | |
can anybody suggest me abt the issues 2 b considered while implementing online examination system for college level... i m planning 2 use jsp and mysql..... any suggestion regarding technology 2 used vl b helpful 2 me..... waiting 4 ur ans.. | |
Hi everyone, I need help in my school project which requires me to send data from a mobile application to a database table. The inputs for the table data is through textfield and when i press the submit button, it will send the input fields into the database table. Will … | |
how to create 2D array of enumeration values foe example i have enum Days {Day1,Day2,Day3} enum Subjects {Subject1,Subject2,Subject3} how can i create its two dimension array two show these values in rows and coloumns | |
please help me how to make different kinds of triangle ,using asterisk("*"),using netbeans.. please.. :(( java.. : input length first then?. * ** *** **** ***** (depends on the length) ***** **** *** ** * (depends on the length) ----* ---** --*** -**** ***** (depends on the length) ***** _**** … | |
hello, i want to write a program that store subjects and days in two enumerations and their values in rows and coloumn using 2D array. how can i do this ? see the image below: [url]http://img718.imageshack.us/img718/3967/sufyan.jpg[/url] So far i've done this, [CODE] class EnumProg { enum Days {Monday, Tuesday, Wednesday, … | |
I'll make it short. First is how do I change the text colour of a [B]disabled[/B] button. I've tried HTML and setForeground but doesn't work. Second, when I want to click a button, I can't move my cursor or the event will not fire. I used addMouseListener because I also … | |
Check my program....i'm printing the values of 2-D array in a ladder form. [CODE] int [][] TwoDArray; TwoDArray = new int [4][]; TwoDArray [0] = new int [1]; TwoDArray [1] = new int [2]; TwoDArray [2] = new int [3]; TwoDArray [3] = new int [4]; [/CODE] This is working … | |
I'm trying to connect to Facebook using Java Sockets and I get a Http: Bad Request Error. The hostname I'm using is "facebook.com" and for the GET request, I have used the following lines. out.write("GET / HTTP/1.1 \n"); out.write("Host:[url]www.facebook.com[/url] \n); The above lines work when the host is [url]www.google.com[/url] or … | |
Can someone help me in connecing the windows using java...? I am doing a project in virtual class..So i need to link the windows. Please help... Thanking u all in advance. Regards, Shreya. | |
hi friends iam sivaji iam devoloping a software for that i need code for sending sms to mobile phone i am devolping my application using java servlet technology if anybody having this program please send the code for my e-mail SNIP please help to me |
The End.