32,204 Topics

Member Avatar for
Member Avatar for kingofdrew

I want in java applet if a user clicks on a rectangle another one is draw. [CODE]import javax.swing.; import java.awt.; import java.awt.event.*; public class stuff extends JApplet { public void paint(Graphics g) { super.paint(g); g.drawRect(40, 40, 200, 200); if(g.isSelected()) { g.drawRect(20, 20, 50, 50); } } }[/CODE]

0
97
Member Avatar for puneetkay

Greetings, Hmm, Im not sure Is this the right place to ask this question, Well If im wrong please correct me. Im working in a company as Java programmer that also provide professional training for Java and two of my trainees have created "Stick Snake" and "Snake and ladders" game …

Member Avatar for Dawenlomo
0
1K
Member Avatar for minghia

I have a class which extends JDialog which by default has some text on it and a couple of buttons. Most of the instance of the buttons are "Ok" and "Cancel" so the two buttons have their bounds set. If I try to change the label on the Ok button …

Member Avatar for minghia
0
203
Member Avatar for BioJavaPhobic

Hello, I'm a biologist trying to do some bioinformatics, so new to Java and new to this forum. I've searched all over the forum for previous threads on this topic, but can't find an answer that has helped me. Apologies if I've missed something already posted that may help solve …

Member Avatar for BioJavaPhobic
0
291
Member Avatar for mangopearapples

I don't know why. At all. Just that it won't repaint! My code: [CODE]import java.awt.Graphics; import java.awt.event.KeyEvent; import java.awt.event.KeyListener; import javax.swing.JFrame; import javax.swing.JPanel; @SuppressWarnings("serial") public class Frame extends JFrame implements KeyListener{ JPanel content; int W = 200; int H = 200; public Frame(){ setSize(700,250); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setResizable(false); content = new JPanel(); …

Member Avatar for mangopearapples
0
178
Member Avatar for C:\>

I have several buttons in my applet, however in certain case i use fillRect function to draw my whole applet go black, but i want to leave one Jbutton visible. The fillRect function hides my button, but the button comes visible if i move mouse cursor on top of it. …

Member Avatar for Ezzaral
0
223
Member Avatar for MeandJava

Hello everybody I have a problem with my code. On two lines (14 & 17) I get this error: cannot return a value from method whose result type is void. But I don't have add void to my class. Thanks in advance. Greets MeandJava Here's my code: [CODE]package oop_po2; import …

Member Avatar for MeandJava
0
2K
Member Avatar for EmbeddedHelp

Evening all, I have created a program that reads a Data Base contents, displays the information, prompts the user to press enter, then in theory they should enter an account number and that specific accounts details be deleted from the data base. Finally the contents of the data base should …

Member Avatar for Ezzaral
0
176
Member Avatar for emorjon2

Hi there! got some problems. I've developing a multiplayer game there's a class called userServer, that use a file to handle all incoming information. but I can't write to the file for some reasons. here's the code: [CODE] /** * @(#)userServer.java * * * @author * @version 1.00 2011/2/16 */ …

Member Avatar for jon.kiparsky
0
314
Member Avatar for ahmed_fawzy

Hey Guys i wonder if any one could help me in setting a background image for JDesktopPane instead of changeing background colors... i'll be gratefull for Detailed Describtion of any written code Thank you people in advance.

Member Avatar for mKorbel
0
2K
Member Avatar for emorjon2

Hi there! I have some problem with java. I developing a multiplayer applet, there a class called userServer registry new users and logging in other users. the problem is, that I don't know how to append in a array. [CODE] user Users[]; int cnt=0; Users[cnt] = new user("emorjon2", "password"); cnt++; …

Member Avatar for JamesCherrill
0
167
Member Avatar for Taimoor Rana

Hello Guys, I know how to draw line and shapes but how can i draw a parabol??? ( i need a 2D line) Any suggestion or pointers are appreciated!

Member Avatar for Ezzaral
0
88
Member Avatar for bullockc83
Member Avatar for Gheter

Hi, I urgently need a java applet to make fractals like this one: [URL="http://www.fractalposter.com/fractal_generator.php"]http://www.fractalposter.com/fractal_generator.php[/URL]. Please can someone give me the code? Thanks Gheter

Member Avatar for javanoob101
-1
213
Member Avatar for r0n

hello everyone, got issue regarding reading duplicate records in a text file... i need to read the file and look for any duplicates data/keys in the text file and write them to another file (all the duplicates records)... how can i do that, in looping...:-/ any help...:) thanks!

Member Avatar for r0n
0
2K
Member Avatar for sj5536

hi, i am using ITEXT to create Pdf File . i want to reduce spacing between lines in pdf file is this possible if it is possible then how can i do that. thankx

Member Avatar for peter_budo
0
168
Member Avatar for didingnuriska

Hi there, I am a newbie in this forum,:) I have problem with the R-SVD java for object tracking in video, Any body can help? the references or code maybe... here a give the file of formula of R-SVD for object tracking, I feel difficult to understand and make the …

0
41
Member Avatar for pkty31

/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package com.skynet.simpleHttpServer; /** * * @author Gryffy */ /* "Copyright (C) 2001,2005 by SkyNet Corporation \n"+ "\n"+ "Redistribution and use in source and binary forms, with or without\n"+ "modification, are permitted …

Member Avatar for masijade
0
464
Member Avatar for javagiek

i am having trouble with this code. It does not let me compile in eclipse but there seems to be no error? Any clue where my mistake lies? thank you [CODE] package useToken; import java.io.*; class readFile extends StreamTokenizer { readFile(InputStream in ){ super(in); } public static void main (String …

Member Avatar for ztini
0
101
Member Avatar for sanam_1

Why eclipse is giving me different answer every time with same program code?is it stack overflow or something?plzz help e fellow programmers. (im using the input box)

Member Avatar for ztini
0
43
Member Avatar for McCurry0x77

I'm trying to run through a file and add each string in the file to a string array. My code yields the error "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at StudentLAM.main(StudentLAM.java:14)" Why doesn't this work? Note: I cannot use ArrayList. My error-yielding code: [CODE] private Scanner index; int cell = …

Member Avatar for jon.kiparsky
0
290
Member Avatar for matstars

I have a JSP page that has two pieces of data that I need to send to a page on another domain via post when a button is clicked. My original iteration was just having the two pieces of data in 2 hidden fields and when the user clicked a …

0
116
Member Avatar for spoonlicker

[B]I just started to learn Java a few weeks ago but gave up on it after hours of attempts and my code didn't work. Here is my input: [/B] [CODE]class JAVA { public static void main(String Args[]) { System.out.println("Hello World"); } }[/CODE] I saved it as JAVA.java and tried to …

Member Avatar for ztini
0
203
Member Avatar for Aldoody

This is the program I'm working on and I'm completely lost A Pythagorean triple is a set of numbers A, B, C such that A2 + B2 = C2. Write a subroutine that determines if 3 given numbers are a Pythagorean triple. The subroutine should print out an appropriate comment …

Member Avatar for ztini
0
112
Member Avatar for aanders5

Ok, so basically i am just trying to pull plain text from a website. basically it will display a person's Runescape stat's in text form. here is my code so far on how to get the url for the page. [code] private void statsButtonActionPerformed(java.awt.event.ActionEvent evt) { String oldrsn = rsnTextField.getText(); …

Member Avatar for aanders5
0
338
Member Avatar for mikesilvey

Hi, im new to jsp and have made a few pages, and can display them using Tomcat, ive made a page counter and managed some validation of a form, but i cannot get this to work: i have a form where you can select a product, then type in the …

Member Avatar for Busang
0
183
Member Avatar for chiefpf

Concatenate a substring of the original string sentence starting from index 0 and ending before the middle Character(s). Use the substring() method. Use an if statement to account for even or odd, the end index that you need substring()the end index that you need for substring() will be different public …

Member Avatar for jon.kiparsky
0
164
Member Avatar for Aniket_Sharma

I am a beginner in Jpcap. My problem is as follows:- i am trying to send a TCP packet but unable to receive it. The code for sending Tcp packet is as follows. I am working on Windows XP. hoping for reply. [CODE]//code for sending import jpcap.*; import jpcap.packet.*; import …

0
113
Member Avatar for lu25

hey i need some help with my assignment am a seriose beginner i need to create a program using arrays that prompts the user to write a sentence and then prints outs the word and the number of times its appearing..i don't know where to begin please help :(

Member Avatar for lu25
0
86
Member Avatar for zyaday

What is wrong with my code? I'm trying to add a list of paths to a DefaultMutableTreeNode... I'm not getting the result I expect...can anyone help why?... [CODE] public static void main(String [] args){ List lst = new ArrayList<String>(); lst.add("a/b"); lst.add("a/b/c/d"); lst.add("a/b/c"); DefaultMutableTreeNode node = new DefaultMutableTreeNode(""); DefaultMutableTreeNode traverser = …

Member Avatar for mKorbel
0
128

The End.