32,204 Topics

Member Avatar for
Member Avatar for NewOrder

[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 …

Member Avatar for NewOrder
0
113
Member Avatar for jemz

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 …

Member Avatar for jemz
0
382
Member Avatar for pptech

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 …

Member Avatar for tong1
0
7K
Member Avatar for kdmuk10

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 …

Member Avatar for kdmuk10
0
163
Member Avatar for gauravk_bhanot

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; …

Member Avatar for tong1
0
310
Member Avatar for nbaztec

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 …

Member Avatar for nbaztec
0
139
Member Avatar for PeterKerk

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" …

Member Avatar for parry_kulk
0
608
Member Avatar for tong1

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 …

Member Avatar for ~s.o.s~
0
2K
Member Avatar for SeanC

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 …

Member Avatar for SeanC
0
86
Member Avatar for prem2

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

Member Avatar for prem2
0
111
Member Avatar for gloriak

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.

Member Avatar for gloriak
0
45
Member Avatar for zyaday

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 …

Member Avatar for java_programmer
0
82
Member Avatar for asad_80

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 …

Member Avatar for NormR1
0
87
Member Avatar for comSysStudent

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 …

Member Avatar for comSysStudent
0
100
Member Avatar for comSysStudent

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 …

Member Avatar for comSysStudent
0
140
Member Avatar for shock8

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 …

Member Avatar for shock8
0
165
Member Avatar for Xufyan

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

Member Avatar for tong1
0
6K
Member Avatar for zombieman023

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) ***** _**** …

Member Avatar for tong1
0
33
Member Avatar for Xufyan

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, …

Member Avatar for java_programmer
0
416
Member Avatar for Agent Cosmic

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 …

Member Avatar for Agent Cosmic
0
102
Member Avatar for Xufyan

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 …

Member Avatar for tong1
0
120
Member Avatar for kiranpvsr

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 …

Member Avatar for NormR1
0
95
Member Avatar for Shreya J

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.

Member Avatar for NormR1
0
65
Member Avatar for nsivaji

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

0
29
Member Avatar for kdgeiger

I am trying to create an array of 20 values the have 4 methods that 1st will create a total of all values listed, 2nd search the array and return all values less than 5.00, 3rd return the average of the values using the output method from the first method …

Member Avatar for kdgeiger
0
201
Member Avatar for nocookies92

I'm relatively new to Java and I was trying to make one my programs more accessible to my non-computer savvy friends with java web start. I took my .class file and archived it with the command: [TEX]jar -cf TabbedLatinHelp.jar TabbedLatingHelp.class[/TEX] I then created a .jnlp file and uploaded the .jar …

Member Avatar for nocookies92
0
2K
Member Avatar for intes77

here's my code, i wanted to add another button that would have its own ActionListener. NOTE: its in object oriented style. i wanted to add these codes in my main class for my additional buttons, but my problem is i dont know how to make their ActionListeners. [CODE]myButton2=new Button("GET DIAMETER"); …

Member Avatar for JamesCherrill
0
218
Member Avatar for Jb2481

Hello, I'm trying to figure out this method were i add courses to a student. and then call it in the main method . [code] public ArrayList getCourseList(){ return courseList; } public boolean addCourse(EnrolledCourse courseName){ for (int i = 0; i <= courseList.size(); ++i ) if(courseList.contains(null)){ courseName.getCoursename(); this.courseList.add(courseName); return true; …

Member Avatar for jon.kiparsky
0
741
Member Avatar for gaurav17may

I am trying to make a rectangle which can be resize when i stretch its borders and this rectangle will drag n drop also.this rectangle will grab a jpeg picture and paste in new panel area.nay help is appreciated thank you....

Member Avatar for NormR1
0
32
Member Avatar for arunmani4u

Hi frinends, I am Arunkumar I have to write a code to fetch every information from a computer including Hardware ,Software and every thing from system....i wrote code to get hardware information but i need help to fetch software information from system..please any one can help me

Member Avatar for NormR1
0
188

The End.