32,199 Topics

Member Avatar for
Member Avatar for sarrrry92

Never mind my last post(I don't know how to detete) How to do the main? Write a program that has an array of 5 Strings, and determines which ones are palindromes (letter-case does not matter) . Your code will be written in one class Palindrome.java and has a main() method. …

Member Avatar for joankim
0
149
Member Avatar for brandon66

Hey guys im new to java in the process of learning how would i go buy adding exceptions to my code with a try/catch when i divide by zero or enter a word instead of and integer. package errorapp; /** * * @author Brandon */ import javax.swing.JOptionPane; import java.util.InputMismatchException; public …

Member Avatar for NormR1
0
209
Member Avatar for ITOzann

Hello guys, I've been trying to finish a project. But I seem to be stuck. I'm suppose to get the following output: [1:18:10, 2:33:10, 3:21:10] Remove customer:1:18:10 Remove customer:2:33:10 Remove customer:3:21:10 [Cashier:1001:0-0:Customer:null, Cashier:1002:0-0:Customer:null, Cashier:1003:0- 0:Customer:null, Cashier:1004:0-0:Customer:null] Remove free cashier:Cashier:1001:0-0:Customer:null Remove free cashier:Cashier:1002:0-0:Customer:null Remove free cashier:Cashier:1003:0-0:Customer:null Remove free cashier:Cashier:1004:0-0:Customer:null [Cashier:1001:13-31:Customer:1:18:10, Cashier:1002:13-46:Customer:2:33:10, …

Member Avatar for ITOzann
0
379
Member Avatar for koricha

i am trying to get the sum of 2 number.. it should give me a message if the sum is correct. i get an error "21 in the jsp file: /index.jsp Incompatible operand types String and int" .any suggestions whats wrong with the program. <%@ page import="java.io.*"%><%@ page import="java.util.*"%><?xml version="1.0" …

Member Avatar for IIM
0
2K
Member Avatar for lena1990

hi i want to move from one applet that is displayed in html to another applet that is also displayed in html how i can do that thanks for help

Member Avatar for NormR1
0
89
Member Avatar for DavidKroukamp

Hmm i really like what applications like Windows Media Player and VLC player can do, and by this i mean: you know when you are watching a movie or listening to music and you minimize the window? Well if you hover the taskbar icon of the minized window with your …

0
189
Member Avatar for tendaimare

I am going through some tutorials in java and I would like to do my first insert into an SQL express database using java .I saw some tutorial recomending jdbc insert. I would like to know which is the best and most reccomended way to carry out an insert into …

Member Avatar for tendaimare
0
159
Member Avatar for UnhingedToker

I have an image consisting of lot of different frames. There are a lot of transparent pixels in the frames. I have to split the image into individual frames and iterate over the pixel data in an input image/buffer and copy out rectangular regions containing non-transparent pixel data into individual …

Member Avatar for JamesCherrill
0
166
Member Avatar for jimoaks

Hello, I have two problems. First, I am trying to have a set background image that displays with two jbuttons on the bottom. My error is that when the back ground image is displayed it hides the buttons (until you mouse over them). Second, I want the buttons on the …

Member Avatar for JamesCherrill
0
393
Member Avatar for bhallarahul

can you please tell me that is this right forum to discuss problem on struts2 if yes, please then please look at the problem[Click Here](http://www.daniweb.com/software-development/java/threads/421470/file-upload-in-struts2) if no, then sorry for my post

Member Avatar for harinath_2007
0
60
Member Avatar for justindill

Need to add a JCombobox to select the user’s State of birth, and a JRadio buttons to indicate their gender. Also, add a JTextArea to the form. Once the user clicks on the JButton the application will display all of the user’s information in the JTextearea. All the classes work …

Member Avatar for NormR1
0
140
Member Avatar for Mopikope

I am in the process of creating a jackpot game. At the moment I am stuck trying to cycle through the different pictures and stop on a random picture for 5 different slots. So far I have this for animating: private void animatePictures() { Thread timer = new Thread() { …

Member Avatar for NormR1
0
233
Member Avatar for apanimesh061

I am trying to implement ROCK algorithm in JAVA. It is used to cluster categorical data. I have like N statements that are to be clustered. This is a good example of this algorithm: faculty.ksu.edu.sa/ykhlef/mscThesis/clustering-P1.ppt I have coded till number of links for each cluster. But I cannot understand how …

Member Avatar for NormR1
0
101
Member Avatar for mehnihma

How can I turn radio button in another class which I cannot change but I need to turn it on from another class? How can I pass action event to it? Thanks

Member Avatar for mehnihma
0
221
Member Avatar for knowledgelover

Hi there, I need to call a dll file that was written in VB.Net, in my java application using the jacob [com.jacob.com] , after successfully registering the dll file, I am trying to instantiate an ActiveXComponent object using my dll, : [QUOTE]ActiveXComponent myComp = new ActiveXComponent("Myfile.dllfile");[/QUOTE] where Myfile.dllfile is currently …

Member Avatar for muscailie
0
1K
Member Avatar for makehaste

Per the title, I'm trying to make my GUI change with the RadioButton selection. Specifically, I want to control which JLabels and JTextFields are displayed based on the RadioButton selection. Right now, my GUI displays the Employee ID, Last Name, First Name, Credit Rate, and Credit # Labels, and their …

Member Avatar for NormR1
0
344
Member Avatar for sarrrry92

Ok, I've been trying to do this for a few days, But I'm not getting it. Our Prof. is not very good, and I have no one to ask how to do this, I really need help with this. Write a program that has an array of 5 Strings, and …

Member Avatar for NormR1
0
162
Member Avatar for apanimesh061

import java.sql.*; import java.util.ArrayList; import java.util.Iterator; /** * * @author Animesh Pandey */ public class dbConnect{ jaccardIndex ji; public float calcJaccard(String s1, String s2) throws Exception { ji = new jaccardIndex(); float sim = ji.Jaccard(s1, s2); System.out.println("calcJaccard"); return sim; } @SuppressWarnings("static-access") public int getLength(String s) throws Exception { ji = …

Member Avatar for JamesCherrill
0
134
Member Avatar for michelleradu

Hi All, I have to split a text into words using both spaces and punctuation as delimiters. Punctuation includes characters like .,!?:;'"- I am using the split function as it follows: [CODE]wordsArray = strLine.split("[.,!?:;'\"-]+\\s*");[/CODE] However, this only splits my text by spaces and ignores other characters I've set as delimiters. …

Member Avatar for ~s.o.s~
0
7K
Member Avatar for mehnihma

I have problem with this part of the code private char encryptChar(char c, int shift) { if (Character.isLetter(c)) return (char) ('A' + (c - 'A' + shift) % 26); else return c; } private String encryptMessage(String msg, int shift) { String result = ""; for (int i = 0; i …

Member Avatar for mehnihma
0
204
Member Avatar for uurcnyldrm

Hi, I'm looking for a way to write a recursive method which convert a decimal to value to its binary equivalent. I can write a method which returns the result as a String, but I can't figure out to write a method which makes calculation with integer values and returns …

Member Avatar for scudzilla
0
210
Member Avatar for wolwayne

Am getting **java.lang.IndexOutOfBoundsException** while I try to uplaod a file to server. I checked the code at loaclhost and it was working fine, but after uploading it to the server am getting the error. **upload.jsp** <form action="UploadServlet" method="post" enctype="multipart/form-data"> <input type="file" name="select" value="" /> <input type="submit" value="Select Profile Pic" /> …

Member Avatar for IIM
0
414
Member Avatar for migelitto

Hi. I am making JMenuBars in my way but i start to understand, that my way ir crap! :D So I want to know, if there is a way, **how to know, which item from menu is set.** For example - i have menu with actors - i choose one, …

Member Avatar for migelitto
0
199
Member Avatar for alexpegg1

I am trying to create a rudimentary number guessing program with java, and it is not working out. I think i have some useless stuff in there, but whatever: import java.util.Random; import java.io.* ; public final class Number_guesser { public static final void main(String... aArgs){ InputStreamReader istream = new InputStreamReader(System.in) …

Member Avatar for NormR1
0
256
Member Avatar for Nimzy

Hey can u help me with this code..?? Its a simple game of moving darts I made on applet.. I want to restart the game from starting when i click replay but this ain't happening, please check the code: import java.io.*; import java.net.*; import java.applet.*; import java.awt.*; import java.awt.event.*; public …

Member Avatar for NormR1
0
833
Member Avatar for soham.m17

JLabel[] x=new JLabel[10]; int i=0; for(component comps : a.getComponent_list()) { x[i]=comps.getType().getImg(); x[i].setBounds(comps.getPosition().x, comps.getPosition().y, comps.getType().getWidth(), comps.getType().getHeight()); System.out.println("Coming Here,"+comps.getId()+","+comps.getPosition().x); this.add(x[i]); i++; } repaint(); I want to have all the labels in their position. after this function. but only the last added label is shown. What can I do?

Member Avatar for soham.m17
0
720
Member Avatar for soham.m17

Suppose below is my code : public void paintComponent( Graphics g ) { graphics2D = (Graphics2D)g; graphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); graphics2D.setPaint(Color.white); graphics2D.fillRect(0, 0, getSize().width, getSize().height); graphics2D.setColor(Color.black); } and graphics2D is global variable declared like : private Graphics2D graphics2D; Now, how can I access g to draw lines from other methods? When I'm …

Member Avatar for NormR1
0
95
Member Avatar for renzlo

Hi Java Developers, I don't know if this is the right place to ask but I hope It is. First of all this is not my programming language, I am an intermediate .net developer, I just came up with this problem that I need to solve which what the thread …

Member Avatar for renzlo
0
327
Member Avatar for bhawna_5nov

here is the following code in java applet.. [CODE]//this is one applet which has to be opened when button is clicked... import java.awt.*; import java.applet.*; import java.awt.event.*; public class Order_info extends Applet implements ItemListener { private Label l,l1,l2; private TextField t=new TextField(); private Choice list; String s,selection; public void init() …

Member Avatar for NormR1
0
1K
Member Avatar for pritish.kamath

i wanted to display a pattern like this 4444 333 22 1 i used the following code import java.util.*; public class PatternExp { public static void main (String args[]) { Scanner src=new Scanner(System.in); System.out.println("Enter the number of lines needed"); int n=src.nextInt(); for (int i=n; i>0; i--) { for(int j=n; j>0; …

Member Avatar for pritish.kamath
0
128

The End.