36,051 Topics

Member Avatar for
Member Avatar for chern4ever

i m trying to write a gui java program. i have a main screen, i declared my object in the main screen class. in the main screen, i will call 2 jpanel. from different class how can i make the 2 jpanel use the same object i declared on my …

Member Avatar for chern4ever
0
161
Member Avatar for vAshunk

I created a program To return if a String entry is equal to "password". Sort of a password program. As you can see from the output the entry and expression are both equal. Why then does it print wrong?? [CODE]package Main; import java.io.*; class password { public void password() throws …

Member Avatar for ~s.o.s~
0
143
Member Avatar for Chaster

Maybe not the best forum to post this, but anyway; The problem is that I have a DB table that has a composite PK.This composite key is built up from an id, and a foreign key which is another id in another table. I have the mappings for these tables, …

0
50
Member Avatar for nikhilmohan

can anyone help me to backup/restore my database file by using jsp code??? im using postgres sql... please its urgnt..tnx in adv. i am using fedora 11 i got this code from an article. but i know it will not wrk.. pls help me if any one hav any idea. …

Member Avatar for jwenting
0
209
Member Avatar for tlnarayana
Member Avatar for jwenting
0
35
Member Avatar for litchi

Hi :) I am Writing a program that takes text from a JTextArea and uses the string to do things upon clicking a button. I used an ActionListener for the button. My problem is that I recieve an empty string when I try to access the text from the JTextArea …

Member Avatar for litchi
0
128
Member Avatar for PhiberOptik

Hey guys I am calling two images using the code below, the first image called shows up when run, and when compiled into a executable jar. The other image shows up when run in eclipse but not when compiled into an executable jar: Here is the code: [CODE=java]image = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource("myPicture.png"));[/CODE] …

Member Avatar for JamesCherrill
0
95
Member Avatar for twgood

Here is my assignment:Choose a product that lends itself to an inventory (for example, products at your workplace, office supplies, music CDs, DVD movies, or software). • Create a product class that holds the item number, the name of the product, the number of units in stock, and the price …

Member Avatar for Sister_loulou
0
138
Member Avatar for achiman

Hey I have just developed a client server chat system but I am having problem trying to save the conversation. Can anyone tell me how I can do this, I am not sure if I have to convert the inputstream to file or the datastream to file or neither. thanks

0
55
Member Avatar for monkey0525

I'm writing a program which prompts the user to enter a sentence and then prompt the user to enter a single letter of the alphabet (into a char value). It's also supposed to count and display the number of words containing the letter entered (not case sensitive) and the total …

Member Avatar for BestJewSinceJC
0
129
Member Avatar for Aisha25

Suppose you save $100 each month into a savings account with the annual interest rate 5%. So, the monthly interest rate is 0.05/12 = 0.00417. After the first month, the value in the account becomes 100 * (1 + 0.00417) = 100.417 After the second month, the value in the …

Member Avatar for kvass
-1
816
Member Avatar for David22

Hello DaniWeb community! I come to you in need of some guidance on a quite frustrating problem. In a nutshell, I am building a java system in which users can keep track of weather forecasts at a list of registered locations, which they can add or remove from their "watchlist". …

Member Avatar for BestJewSinceJC
0
140
Member Avatar for snprime

Hi all, I'm working on a program for my data handling class and I have a quick question. I'm trying to write a method that prints a range of elements in an array. I have written it in such a way that I create a new, smaller array with the …

Member Avatar for snprime
0
107
Member Avatar for idlackage

I'm supposed to allow the user to draw shapes based on their combobox choices (eg. line, rectangle, circle), colour, fill state, etc. However, nothing is showing up. Model class: [CODE]import java.awt.Color; import java.awt.Graphics; import javax.swing.JPanel; import javax.swing.JLabel; import javax.swing.JOptionPane; import java.awt.event.MouseAdapter; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.awt.event.MouseEvent; public class DrawPanel …

Member Avatar for Ezzaral
0
191
Member Avatar for leliana

hi .. i wanna read text file in binary format ... 4 ex : lele and raz ..."in text file " l=10011001 e= 011110011 ..... "cmd (8 bit per letter)" and but them in an array ...i tried the type StringBuilder but it didnt work ... i need a method …

Member Avatar for leliana
0
1K
Member Avatar for ozidub

Hi, I'm new to Java and am having a problem getting my program to run, any help would be greatly appreciated. Here is the program: [CODE]//This program displays a message asking the user if they //want to know the Top Premiership Players. If they say Yes, //they will then be …

Member Avatar for masijade
0
107
Member Avatar for neovo-88

Hi, Im new to java and was wondering if someone could help me with my problem. Im writing a program which will calculate how long a journey will take, the user will need to enter a character to represent what type of road/speed they are doing and how long the …

Member Avatar for neovo-88
0
169
Member Avatar for Dark.Paladin

hy im having a little problem with a loop with jgrasp here is my basic program [code] import javax.swing.JOptionPane; public class loops1 { public static void main (String[]args) { String name do { String name = JOptionPane.showInputDialog ("who is the cleverest person in the room?"); } while (name != "erin"); …

Member Avatar for Dark.Paladin
0
156
Member Avatar for rogue005

I am doing a project on a network printer spooler. I want to know what APIs are available in Java to interact with a printer.

Member Avatar for gangsta1903
0
76
Member Avatar for chie12024

import java.io.*; public class EggTrader { public static void main(String[]args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int numofEggs,EggCount,Cash; double cashOnHand = 500; double pricePerdozen = 72; double unitPrice; public void buyOneDozen(double pricePerdozen) { numofEggs = Integer.parseInt(br.readLine()); numofEggs = getEggCount(numEggs,cashOnHand); } public void sellEggs(int numEggs,double unitPrice) { numofEggs = …

Member Avatar for viswaratha
0
229
Member Avatar for blazinhieu

how do i write a program that a user can input 3 numbers (between 0 and 100), then the program will compare if the numbers are bigger are smaller than each other, and weather each number is smaller than 100 or greater than 0. required 2 class file in one …

Member Avatar for stultuske
0
108
Member Avatar for solomon_13000

Does anyone know why Hibernate and Struts are referred to as a Single-tier framework when compared to Spring?.

0
85
Member Avatar for jamesonh20

Hello I am trying to underline --> 1 5 6 only the 1 2 2 2 only the middle 2 1 6 4 only the 4 I have imported the java.awt.* but im not sure how to write the code, the java api is a little confusing. [CODE]import java.awt.*; public …

0
64
Member Avatar for JavaNewbieEK

I have a two input text field window in which users input an ID and Password. I then need to compare these passwords to allowable users. What would be the best method for associating each unique password with its specific user id?

Member Avatar for javaAddict
0
168
Member Avatar for prodam

i am new both to this forum and to the programming world but I know a little of java programming, html and am really interested in becoming a full time java programmer or developer.. But get confused when i read about visual basics Pls i need clarificatiions and opinions thanks

Member Avatar for strmstn
0
78
Member Avatar for noumanayub

Hi Guys! I am doing a shopping Mall Project! I want that you people give me suggestions in order to make this project perfect... Regards Nouman Ayub.

Member Avatar for stultuske
0
49
Member Avatar for pfuturama

//less than 10= "too cold", 10-20= "avarage", 21-30="hot",bigger than 30 ="Too Hot" import javax.swing.JOptionPane; public class TmaTwo { public static void main(String[] args) { int number; int temp; String numString; numString = JOptionPane.showInputDialog ("Enter temperature:"); number = Integer.parseInt(numString); if (number < 10 ) JOptionPane.showMessageDialog(null, "Too cold", "Output", JOptionPane.INFORMATION_MESSAGE); else if …

Member Avatar for stultuske
0
106
Member Avatar for yasir iqbal

How to use delay function in turtle class in java,oop when drawing an object

Member Avatar for stultuske
0
31
Member Avatar for JavaNewbieEK

Hi, I am a student who has been given the following assignment. Before I am reprimanded for posting asking for assistance without providing an attempt at code, please allow me to explain. We have been given the assignment shown below with no explanation. We have not covered any of the …

Member Avatar for stultuske
0
191
Member Avatar for litchi

Hi :) Is there any way to look up a character's Unicode line number? Ex. Capital letter A's line number (hex) is 41 capital B is 42 etc. (more info [URL="http://www.utf8-chartable.de/"]here[/URL]) Or would I have to put them in an array manually? thanks :)

Member Avatar for litchi
0
97
Member Avatar for y7cs228

hello everyone i am creating a notepad using java swings. how to save the text in textpane with font styles ......

Member Avatar for kvprajapati
0
33
Member Avatar for chandu_517

Hi all, I'm new to JTable. I have two buttons "add Row", "Del Row" and I have some records displayed from db which contains an auto increment column. when ever "add row" is clicked a new record will be added to JTable with a auto increment column number displayed in …

Member Avatar for chandu_517
0
197
Member Avatar for PhiberOptik

Hey guys, I'm using a Point array to transfer to my panel class that draws the image. The reason I'm using coords is because it shows where the character is in the tileset for directions Ie. (20,5) is right step facing up. anyway its coming up with null pointer and …

Member Avatar for ~s.o.s~
0
101
Member Avatar for ksaihat

its java assignment i dont know how to do this part allow user to determine whether a given (whole ) number is a Fibonacci number or not print massage on the screen with the result of your option: either the number is a fibonacci number or the number is not …

Member Avatar for kvass
0
129
Member Avatar for joelRam90

Hi everyone, I'm developing a new program. ;) My "dilema" is as follows: :S Let's say that I have a Java component, a calendar, shown in the GUI and I want to cover it with and invisible label or something so it can't be modified by the user. I don't …

Member Avatar for joelRam90
0
194
Member Avatar for Bobon

I'm having a problem completing the question below. I am a Java noob so be gentle ;0. The problem is in relation to the equals() method. I have to use this method to check dates to see whether they match. Please see code below. [CODE]public boolean equals(){ if(date1==date2){ return true; …

Member Avatar for kvass
0
101
Member Avatar for David22

Hi guys. I am having issues with a program I am writing. Basically, I have a JList that stores toString() references of "Location" type objects. I want to be able to remove these. However, the "Location" type objects are stored in an ArrayList, hence requiring an overriding toString() method to …

Member Avatar for BestJewSinceJC
0
119
Member Avatar for Alex_

Hello, i made a basic java desktop application. After building the interface in the form, i compiled it and it worked perfectly. But after i added an event to a button (on click) my app won't close. I use the X button from the title bar, or ctrl+q from the …

Member Avatar for Alex_
0
2K
Member Avatar for dj118

Hi viewers, I'm in dire need of some help. I'm currently doing a program for my studies and I have successfully compiled it and tested it. However when I try to execute the program it comes up with the error java.lang.NoSuchMethodError: Main. I've identified the problem which is the fact …

Member Avatar for dj118
0
195
Member Avatar for achiman

Hey please I am trying to create a chat system but my main server routine in my server class keeps give error saying its out of bound. I think it is the port number but dont know how to fix it. Is there anyway I can hard code the port …

Member Avatar for masijade
0
84
Member Avatar for upasanac

I have this function which computes the position record of 6 requests. ( ie x,y,dx,dy--these are the position records for a request) I want to display these position records in a textfield, which i have in my GUI, as soon as i press the "positionrecord" button. I am able to …

Member Avatar for Ezzaral
0
155
Member Avatar for hallinan

[B]Hi I am trying to create a generic class form existing code I have tried to figure it out but with no avail if anyone could help it would be much appreciated I have tried to do it and this is what I have so far[/B] Here is the Class …

0
55
Member Avatar for vij123

i have a Jsp page. in this Jsp page having some links. i want when i click to link of result some data should be display. but it does not displaying. please check the below code. Indus.jsp [CODE] <html> <head> <title>Indus Public School</title> </head> <body> <div align="center"><font size="+3"> Indus Public …

Member Avatar for vij123
0
123
Member Avatar for vij123

I have two Jsp pages named bestschool.jsp and schoolnames.jsp. I am calling schoolnames.jsp from bestschool.jsp. I want when I click the link on INDUS School. It can show all concerning link of INDUS School links like profile, result, facility etc. in the same place instead of other naming school links. …

Member Avatar for vij123
0
194
Member Avatar for bustersox

I am having issues getting my code to work properly. The objective of the program is to allow the user to enter 5 scores and then it is supposed to calculate the mean and rearrange the data set from highest to lowest (descending order). I am supposed to run it …

Member Avatar for stevelg
0
2K
Member Avatar for karthickj25

hi i am new to jsp, i need to create a jsp page that has list All, Add, Delete, Update button, the page should display all the records from the database when list All button is clicked and adds new record when add button is clicked and so on, is …

Member Avatar for musthafa.aj
0
143
Member Avatar for ksaihat

how can i use System.out.printf to depost value in dollars 2- the number that represent as percentage eg.4.0% whould be entered as 4.0 thanks

0
71
Member Avatar for liaa

Filename: CommonLetters.java Problem Statement: Write a program that takes two words as input and finds any common letters that they have. For example, the words ‘computer’ and ‘program’ have the letters ‘o’, ‘m’, ‘p’, and ‘r’ in common. The input to the program will be a string which contains two …

Member Avatar for javaAddict
-1
189
Member Avatar for maverick_ymca

Hi, Here at my organization we'd been using an app which worked perfectly fine on the current 5.5 tomcat. But now we wished to upgrade our server to version 6.0 . The problem is that the application almost refuses to start up. I had this web.xml modified to comment out …

Member Avatar for ~s.o.s~
0
99
Member Avatar for houlahan

OK so im new to XML i want to save lots of serialized objects to XML then read the objects back in from the xml with ease using the get and set methods i have in place, is they any real easy way of doing this? thanks in advanced Houlahan.

Member Avatar for ~s.o.s~
0
77

The End.