32,204 Topics

Member Avatar for
Member Avatar for VernonDozier

I've made a small program that draws black rectangles on a JPanel at random places. I would like to give the user the option to save this JPanel as a .gif file, but I'm not sure where to start. The function I need to write is SaveJPanelAsGIF below on line …

Member Avatar for ferwerda
0
414
Member Avatar for Lemony Lime

I've done some searching, and it seems a few people have asked similar questions, but none of them were quite what I was looking for. I need to be able to read lines of code from a .txt file, and then execute them in Java. Or, if that's impossible, would …

Member Avatar for NormR1
0
3K
Member Avatar for inamul20

Hi!! my application have 2 frames including tabel 1,tabel 2 when run time i insert values though textfileds to tabel 1 ,after inserting 5 or more then i click next button then display other frame with tabel 2 and tabel 2 must auto filled. my problm is last row(i already …

Member Avatar for JamesCherrill
0
235
Member Avatar for arias36028

Hi, I'm new to Java, getting compiler error for the following code: class A { int x; A (int a) {System.out.println ("class A");} } class B extends A{ int x; B() {System.out.println ("class B");} public static void main (String[] args) { A a= new B(); } } The compiler error …

Member Avatar for JamesCherrill
0
271
Member Avatar for Bud4java

Is there a "neater" way to code the following? (It prints the 5 data elements in an array.) System.out.println("All the values in the array are: "); System.out.println(+ array1[0]); System.out.println(+ array1[1]); System.out.println(+ array1[2]); System.out.println(+ array1[3]); System.out.println(+ array1[4]); Thanks, Bud

Member Avatar for peter_budo
0
250
Member Avatar for junchronick

Good day! I was writing a code that will compute the salary of each employee on our school depending on their position using a FileReader(File Handling). I only managed to do this code and don't know how to start again [CODE] import java.io.*; import static java.lang.System.out; public class admin { …

Member Avatar for hfx642
0
117
Member Avatar for baz_thug005

I have an assignment here.Can anyone Please help me in doing it because i haven't copied the codes that my prof gave me. Using BufferedReader create a program that will complete the salary of the employee. Use the ff: formula: BasicPay=Rate * Number of hours worked OvertimePay=(rate * .30 + …

Member Avatar for Ezzaral
-4
81
Member Avatar for stevemag

Hello, I'm trying to write a code to check if two strings are anagrams. i have already figured out a code but I can't get it to work for words of different cases and words with whitespace. I would really appreciate any input Thank you! Here is what I have …

Member Avatar for stultuske
0
312
Member Avatar for Ambitious girl

hi how are you gays in java i have question about constructors , i just starting learning java since few weeks [COLOR="Red"]how i can define string in construtor using one argument ..[/COLOR] how many constructors are there in the string class >? how i can count the number of words …

Member Avatar for NormR1
0
102
Member Avatar for popsyjohnson

hello to all my program creates a boolean for mailing and outputs "i brought my ride " when it is false i.e the customer will not like his purchase to be delivered and outputs "your purchase will be delivered " if it is true...... my problem is it outputs your …

Member Avatar for hfx642
0
118
Member Avatar for CodeAdmiral

For a school project, I am trying to make a program that gets user input and finds the factorial of the input. I wrote this bit of code and got tons of errors. Help, anybody? [CODE]import javax.swing.*; import java.awt.*; import java.io.*; import java.util.*; class TestFactorial { public int x = …

Member Avatar for thines01
0
251
Member Avatar for oldezwe

I am attempting to take 2 integers from a MySql table. X represents a number that will be stored into an array. Y represents the number of times that X will be put into the array. I am attempting to make a loop that will go through, find all the …

Member Avatar for Ezzaral
0
233
Member Avatar for sk8ergirl

I'm practicing for my java test on sunday and I did this lab and everything is okay except for the zero I don't know why the zero is there and I want to reverse the triangle form this : 0 10 210 3210 43210 to this 1 21 321 4321 …

Member Avatar for NormR1
0
503
Member Avatar for sk8ergirl

I'm practicing for my java test on sunday and I did this lab and everything is okay except for the zero I don't know why the zero is there and I want to reverse the triangle form this : 0 10 210 3210 43210 to this 1 21 321 4321 …

Member Avatar for NormR1
0
703
Member Avatar for ahmedshayan

I am in desperate need of help... I were to create Operating System's Shortest Job First Preemptive Algorithm .... The problem is that I am not getting how to calculate the average waiting time of each process... HELP ! SJF.java: [CODE] import javax.swing.JOptionPane; import java.util.*; public class SJF { int …

Member Avatar for Ezzaral
0
3K
Member Avatar for newbie14

Dear All, I am inserting a string value into my mysql db which had apostrophe with no problem because I do this when inserting. [CODE]String cleanMessage = oriMessage.replace("'","\\'");[/CODE] The problem when I try to read from the same table I tried like this [CODE]level2[0] = level2[0].replace("'","\\'"); String queryCheck = "Select …

Member Avatar for thines01
0
186
Member Avatar for gourav1

let an integer say, x=0xffffff0; when i shift left 4 positions in it.it got negative. x=x<<1; doing this 4th time,number got negative. please tell why it is so.

Member Avatar for JamesCherrill
0
288
Member Avatar for JaffaApophis

Hello, I am trying to build a GUI with 2 textfields (1 for tutoring time & 1 for payment for session), a textarea (display the inputs in 2-D array & show report), and a few buttons (ENTER, RUN REPORT & QUIT). The two textfields are for the user to enter …

Member Avatar for JamesCherrill
0
448
Member Avatar for lili.edryana

Hello everybody! Has anyone here used GXT to build web application? I just want to know how did you handle breadcrumb? How you create it?

0
81
Member Avatar for divsok

Suppose the xMethod() is invoked in the following constructor in a class, xMethod() is _________ in the class. public MyClass() { xMethod(); } A. a static method B. an instance method C. a static method or an instance method what is the answer a or b or c

Member Avatar for stultuske
0
1K
Member Avatar for chriswinter

I need this program to encrypt by making letter a letter z and b, y and so on. The proffesor got us started by giving us this program and for the life of me i can't figure out how to change it. [CODE] public class ceaser { public static void …

Member Avatar for NormR1
0
292
Member Avatar for Eragah

Hi! Im a beginner in programming, and I have been given an assignment to program a TicTacToe game. I could not find any programs as such for reference over the Interwebs thus would want the expertise of daniweb users to help. The problem im having: 1. How do i transfer …

Member Avatar for NormR1
0
263
Member Avatar for glenak

Hi all, I'm working on a system that does a bunch of stuff, as well as monitors the current date on a system, checks it against a stored date in a database, and if both dates are exactly the same, sends an email automatically to a bunch of users. Now, …

Member Avatar for NormR1
0
102
Member Avatar for Panathinaikos22

Hello, as i know java source code is visible to ppl, i talk about Desktop Applets, i'm interested to start learn Java/Web Developing, that i want to know is, Can ppl see code of java applet in brwoser? like he can with Java Desktop Appis.

Member Avatar for jwenting
0
262
Member Avatar for spades0001

Hey guys! I created a facebook type program. The user may load an image, tag the image, and remove tags. I've done the loading of an image, now I'm working on tagging the image. My problem is how do i make it so that when I click the "Tag photo" …

Member Avatar for StephNicolaou
0
220
Member Avatar for cvanithakpm

please help me by answereing my three question 1)page redirection is possible through which methods? 2) another question which is the default port number of jws? 3)we can write servlet programs by using http packages only ah?

Member Avatar for StephNicolaou
0
131
Member Avatar for javabeg123

i have to create a city application that prompts the user for a series of city names and then displays the number of city names entered and then the name of the city with the most characters in uppercase letters. how come it always output the last name entered ? …

Member Avatar for stultuske
0
231
Member Avatar for jeffcogswell

Netbeans is a free, open source IDE for developing software in Java. It's been around for almost 15 years, having gotten its start around the time Java began. Version 7.0 is about to be released, and I got my hands on the Beta release of this new version. In the …

Member Avatar for cyvre
3
380
Member Avatar for timmy568

Hi guys i am trying to write a program that uses two classes, Board and Game, to run the Game Of Life. Currently my output is in the console, as a GUI is going to take too long. I am having some trouble writing my nextGeneration method in the Game …

Member Avatar for timmy568
0
137
Member Avatar for dineshswamy

give me reasons why JVM is platform dependent? i dont find convincing answers. The ultimate aim of a compiler is to make codes that are to be understood by native machine processor ? if this is the case why there is an interference of operating system(platform)?

Member Avatar for hfx642
0
102

The End.