36,051 Topics

Member Avatar for
Member Avatar for jet101

guys, good day! I just want to ask how to reload/refresh a JComboBox. I have a cardlayout with 3 panels, each panel has its own combobox. what I want to do is to reload the combobox to its original state each time I swap the cardlayout. updateUI(); repaint(); revalidate(); I …

Member Avatar for jet101
0
738
Member Avatar for zachf632

So I am trying to load a .png file for a very simple game. I have my all of my code saved in the directory: "C:\Users\Zach\Desktop\TestGame\source", and my image that I'm trying to load in a directory called "C:\Users\Zach\Desktop\TestGame\images". To load the image i am using [CODE]ImageIcon ii = new …

Member Avatar for NormR1
0
93
Member Avatar for blondielox

I have pretty much gotten my program to run with one little exception. It is asking for the SKU number which has been set but when I run the program it assigns a number to item and does not give me the sku number I had entered in the program. …

Member Avatar for NormR1
0
119
Member Avatar for t2r

I'm searching for a good tutorial about object oriented analysis and design but can't find any short and clear tutorial which will has: 1. Explanation of oo concepts (very short) 2. CODE EXAMPLE (eg. if someone describe aggregation I wanna see how I can use this in my class) There …

Member Avatar for t2r
0
189
Member Avatar for SagarSe7en

Hello Guys! Posting this thread based on the topic of NumberFormatException null... This is how it goes. Im calling records from the db into a JSP. [CODE]String FirstName = Results.getString("FirstName"); String MiddleName = Results.getString("MiddleName"); String LastName = Results.getString("LastName"); int BorrowerID = Integer.parseInt(Results.getString("BorrowerID"));[/CODE] When i try to call it in the …

0
67
Member Avatar for Dexxta27

I am just learning Java and am trying to use variables from objects that I passed into another method. Can someone help me here [CODE] package data; public class Data { private int day, month, year; public Data(int day, int month, int year) { this.day = day; this.month = month; …

Member Avatar for Dexxta27
0
174
Member Avatar for laguardian

Hey guys! I've created a simple program that given the current day and how many days from the current day, it will determine if it's a Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, where 1 Sun, 2 -Mon, 3-Tues, 4 -Wed, 5 -Thurs, 6 -Fri, 7-Sat My problem is that …

Member Avatar for Majestics
0
376
Member Avatar for kiko11

I had a problem.. when I call a frame which is a GUI and push a button which will be disabled.. and my problem was how should it retain the disabled button if the GUI was called again.. please help.. can you give an example..

Member Avatar for harinath_2007
0
80
Member Avatar for techyworld

Write a program, when given an array of integers, it returns the biggest integer. Can you please tell me what's wrong in this program?? [CODE]import java.util.Scanner; public class Arrayint { public static void main(String[] args) { Scanner input = new Scanner(System.in); int i,index,max; int x; int[] list=new int[x]; max=list[0]; System.out.println("Enter …

Member Avatar for JamesCherrill
0
208
Member Avatar for turi.kololi

Hi, does anyone know a free windows explorer type of project written in java? Basically i just want to implement a simple windows explorer but dont want to start from scratch with all the drag and drops and so on. Thanks

0
44
Member Avatar for sumitkjm

Hi, I am working to call java script function from java program. I am able to do with simple javascript functions like below: ScriptEngineManager factory = new ScriptEngineManager(); ScriptEngine engine = factory.getEngineByName("JavaScript"); engine.eval("function printHello(Str) { print('Hello World') } printHello('Hello World')"); But not able to do the javascript function which includes …

0
49
Member Avatar for anand01

hi, I need to draw bar graph in jsp. give me some suggestion for this. which one will be best whether drawing in java script in or Jfree chart . Thanks in advance

Member Avatar for anand01
0
103
Member Avatar for sahilsinghi

i am truly a beginner.please can anyone assume and help me define main method in this parameterized constructor programme [code]import java.io.*; class studentmarks { String name; double engmarks,phymarks,chemmarks; double tot,avg; public studentmarks(String s,double p,double e,double c) { name=s; engmarks=e; phymarks=p; chemmarks=c; } void compute() { tot=engmarks+phymarks+chemmarks; avg=tot/3; } void display() …

Member Avatar for JamesCherrill
0
369
Member Avatar for aFACE

I am having problems figuring out how to get the results from the strings and then give myself the option to sort through them alphabetically (or numerically). I have the code to the point where it shows the input data but don't know where to go from there. I'm fairly …

Member Avatar for JamesCherrill
0
124
Member Avatar for omeralper

In the main method of a program we always use the code as a parameter: String[] args What does it mean? In the tutorial of java sun, there is a code following [code]public static void main(String[] args) { //this program requires two arguments on the command line if (args.length == …

Member Avatar for hfx642
0
357
Member Avatar for alony

Hi! I'm trying to have the user input the number of hours, minutes, and seconds, and it output what that is in seconds. WHY WONT IT COMPILE... It says i have an illegal start of expresion at private static double hour(). help? [code] import java.util.Scanner; public class timeTest { public …

Member Avatar for hfx642
0
156
Member Avatar for raaif

Im trying to change the title of a mp3 file but it doesnt work ans also error An attempt was made to move the file pointer before the beginning of the file pops up at file seek ive comented it out (ie. '///###@@) in the WriteID3v11() sub heres my code …

Member Avatar for raaif
0
153
Member Avatar for gahhon

i plan to display all of the odd number, and sum all of the odd number. please check with my code, there is something wrong...:) [ICODE]import java.util.Scanner; public class testing { public static void main(String[] args) { int sum = 0; Scanner scan = new Scanner(System.in); System.out.printf("Enter minimum number: "); …

Member Avatar for gahhon
0
186
Member Avatar for jezer08

I have 3 class, 1 for abstract(named Voter) ,1 for the gui components(named LayOut) and 1 for main(named Election). On my main I created an object of the gui class and set the visibility to true and the usual stuffs. but the problem is, on my main I have a …

Member Avatar for JamesCherrill
0
163
Member Avatar for suslady

import java.util.Scanner; class Calculator{ public static void main (String [] args) { Scanner suslady = new Scanner(System.in); int fnum, snum, remander, answer; char operation; System.out.print ("Enter 1st # "); fnum = suslady.nextInt(); operation = suslady.nextChar(); System.out.print ("Enter 2nd # "); snum = suslady.nextInt(); if(operation == '+') { answer = fnum …

Member Avatar for suslady
0
287
Member Avatar for carmzy

I'm can you help me how to count my username and password using an array. I confuse where should I put my counter inorder to up to 5. Hope your Positive response..... here is my code: [code] String[] username=new String[5]; String[] password=new String[5]; public void actionPerformed(ActionEvent e) { if(e.getSource().equals(btnAdd)) { …

Member Avatar for NormR1
0
102
Member Avatar for PearlLV88

import java.util.Scanner; public class Exercise3_1 { public static void main (String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter three edges: "); int integer = input.nextInt(); int edge1 = 1; int edge2 = 1; int edge3 = 1; // First condition: edge1 + edge2 should be greater than or equal …

Member Avatar for NormR1
0
172
Member Avatar for ilovejava

i have to write a program that displays the value of pi for values for i = 10000,20000.....,and 100000 i have to use the following series pi = 4(1-(1/3)+(1/5)-(1/7)+(1/9)-(1/11_+...+(1/(2i +1))-(1/(2i +1)) any ideas i have to do a program with looping i cant use arrays can someone give me a …

Member Avatar for NormR1
0
1K
Member Avatar for lse123

I GUESS THIS IS ERROR - CAN YOU CONFIRM? "You can send an ImageIcon object as the Image argument that drawImage() expects." T/F "To start playing the AudioClip, you need to call the start() method on it." T/F // On the obj mean here?

Member Avatar for mKorbel
0
200
Member Avatar for Feriscool

I'm getting a null pointer exception on lines 17, and 22. I'm not positive, but does it have to do with "int number1 = data[0];" having to be static? [CODE]int number = 100; public static final int[][] NUMBERS = { { 1205, 1206 } }; public static boolean method1() { …

Member Avatar for mKorbel
0
197
Member Avatar for c.pentasuglia

I am working on an assignment for school and i seem to be having some issues. I am using OpenGl with free glut, and attempting to animate a pendulum. I can draw out the pendulum, but cannot determine how to make it swing. I have to make it swing from …

Member Avatar for c.pentasuglia
0
484
Member Avatar for sohiabmaroof

hi all i m facing problem populating jtable with the data of database !m using arraylist to populate jtable .but the problem is that m unable to add databse data into jtables.i m only getting the last row elements of databse. i should be getting this data in the jtables …

Member Avatar for sohiabmaroof
0
192
Member Avatar for Dorar

[COLOR="red"]This is Reservation program full code written in JAVA <from the web> No Problems are in running process. I'm required to convert it to C language.[/COLOR] -- [COLOR="Green"]1- these are lines that i did not understand it. <could any one explain>[/COLOR] a. private static DataInputStream k = new DataInputStream(System.in); //what …

Member Avatar for Dorar
0
233
Member Avatar for keeda

Hi, I have to use Java to build a scrapper, that takes a product name and searches for that product on an e-commerce website. I understand that I will have to use an external library that would parse the html page for me, given the link. But how do I …

Member Avatar for ~s.o.s~
0
188
Member Avatar for anand01

Hi all , I need to transfer data from jsp to servlet.. am accessing db from servlet .. I need to tranfer those db content to my jsp page how can I achieve that . thanks in advance

Member Avatar for anand01
0
5K
Member Avatar for lbgladson

I have a problem to determine Easter Sunday based on the algorithm invented by Carl Friedrick Gauss in 1800. I have written my code and double checked the Math several times but not matter what year I type in it tells me that Easter is on April 9th so I …

Member Avatar for Taywin
0
289
Member Avatar for sha11e

If I need a string or an int from the user, how can I make sure that that is what they inputted? The lame way of putting EVERYTHING in strings and then somehow check? Or maybe throw-catch? I tried the try-catch but had a few problems. The examples I saw …

Member Avatar for NormR1
0
305
Member Avatar for sahilsinghi

i tried to make a executable jar file.a program as follows [CODE]import java.io.*; class studentmarks { String name; double engmarks,phymarks,chemmarks; double tot,avg; public studentmarks(String s,double p,double e,double c) { name=s; engmarks=e; phymarks=p; chemmarks=c; } void compute() { tot=engmarks+phymarks+chemmarks; avg=tot/3; } void display() { System.out.println("nameis:"+name); System.out.println("totalis:"+tot); } }[/CODE] i saved it …

Member Avatar for hfx642
0
185
Member Avatar for madoman10

I am trying to prompt the user for a series of Integers and stop when the user enter a negative number and i am trying to add the number the users entered in a linked list. I was thinking about using the scanner class but i am having problems with …

Member Avatar for Taywin
0
79
Member Avatar for sathya88

how to send mp3,avi(large) files via socket...small files with size less than 100kb is possible but how to send large file..

Member Avatar for NormR1
0
8K
Member Avatar for nikelin

Simple resources loader tool which help to find some file in classpath and load it's content with respect to sanitizing policies.

Member Avatar for JamesCherrill
0
410
Member Avatar for hszforu

i have to convert a string into ascii format and then into it's binary. I know how to convert between int to binary using toBinaryString, so how to convert ascii to int. Or is there any other way to convert string characters into binary form. In short suppose there is …

Member Avatar for hszforu
0
812
Member Avatar for kevvek

How do i write these in a flowchart: ConverterMenu1 cm1 = new ConverterMenu1(); CurrencyConverter cc = new CurrencyConverter(); MeasurementConverter mc = new MeasurementConverter(); Please help me quick!

Member Avatar for NormR1
0
215
Member Avatar for SagarSe7en

Hello Friends! Want to Post something i know might be very weird but this is how it goes. In Java we use [CODE]RS.getString("FirstName");[/CODE] to get the value of the column FirstName from the database. If the valueis not detected then it shows null in the Text Box. [CODE]RS.getInt("StudentID");[/CODE] to get …

Member Avatar for SagarSe7en
0
392
Member Avatar for Feriscool

This is giving me a nullpointerexception: [CODE] public static final int[][] ARRAY = { { NUMBERS } }; public static boolean method1() { for (int[] data : ARRAY) { int numberOne = data[0]; } if (numberOne != numberTwo) { method2(numberOne); } } public static boolean method2(int number) { int count …

Member Avatar for JamesCherrill
0
153
Member Avatar for tyson.crouch

Hey Guys, I'm just trying to set up my Virtual Host file to set up an alias URL. I've configured my Windows\System32\drivers\etc host file to include the following: [CODE]127.0.0.1 internal.test[/CODE] this works well, however I want to be able to do the following: Have this: [B][U]internal.test:8080/Test/[/U][/B] Look like this: [B][U]internal.test/[/U][/B] …

Member Avatar for tyson.crouch
0
76
Member Avatar for lynnb86

I have all my code done, but it keeps saying no suitable constructor found (close to the bottom on the first code- ProduceInfo pInfo section- line 150) and cannot find symbol (line 62). I have read over this code, searched the errors on the net, and watched videos to try …

Member Avatar for lynnb86
0
159
Member Avatar for janice91

Dear Experts, I am new to the LinkedList concept and trying out coding a LinkedList problem which require me to do Insert newInteger based on the Index, Remove Index and Change oldInteger to newInteger based on Index. Please kindly advice what i should code in my [code] public void insert(int …

Member Avatar for Taywin
-1
187
Member Avatar for raviaaaa

After installing tomcat 6.0 server into my machine iam not able to find "start up and shut down" files under bin directory pls tell how to solve this issue

Member Avatar for Taywin
1
187
Member Avatar for dharma117

[CODE] <%-- Document : Login1 Created on : Jul 1, 2011, 1:16:12 AM Author : Dharmendra --%> <%@page contentType="text/html" pageEncoding="UTF-8"%> <%@page import="java.sql.*" %> <%@page import="com.p1.*" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> </head> <body><center> <form action=""> <br>UserID : <input type="text" …

Member Avatar for SagarSe7en
-2
333
Member Avatar for ankit.pandey3

[CODE]import javax.swing.*; import java.awt.event.*; import java.awt.*; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import java.util.TimerTask; /** * @author Adrian BER (beradrian@yahoo.com) */ public class PopupAnkit extends JPanel implements ActionListener{ private JToggleButton invokePopupButton; private JFrame popupWindow; Statement stmt=null; ResultSet rs=null; // int tempCount=0; public static int count=0; /** * Constructor. …

Member Avatar for ~s.o.s~
0
418
Member Avatar for BuhRock

So I created my ArraySet class from an interface. I'm trying to test my union method in my SetApp class, and I truly don't know where to begin. Can someone push me into the right direction? Btw, I know my SetApp class is messy atm, but I was just testing …

Member Avatar for ~s.o.s~
0
382
Member Avatar for manjushreekaran

i want to write a java code that prints the value for xml tags from database in java??? which method is suitable for this??? currently i can able to print <company comp:loc=" "/> here i need to get value for loc=" "... how can i achieve this???

Member Avatar for leiger
0
107
Member Avatar for archie.herbias

Can you suggest a program that i can submit? I need your help for suggestions.. any programs that involves GUI.. simple programs could be.. Thank you!

Member Avatar for leiger
0
226
Member Avatar for gayathriselvam

I hav given the name of file as class name and saved it as .java by creating a folder in c drive.when i try to compile it shows the following exception.pls help me to resolve from this problem C:\Program Files\Java\jdk1.7.0\bin>javac HelloWorldApp.java javac: file not found: HelloWorldApp.java Usage: javac <options> <source …

Member Avatar for leiger
0
196

The End.