32,204 Topics

Member Avatar for
Member Avatar for laguardian

Hello guys! I'm working a project and it seems that there's something wrong with my switch-case. For example, in the user menu, the user can input the number 2 then it would allow them to deposit, but somehow, it keeps displaying the first switch-case. switch(resp){ case 1: users.get(0).displayProfile(); users.get(0).editProfile(); break; …

Member Avatar for stultuske
0
210
Member Avatar for btissam

hi everyone ! I'm working on a network strategy game with 3 components one reffere will define the mission and 2 players will make moves and attacks in a turn based way . in the end of each turn , the reffere will generate a rapport of each player action …

Member Avatar for btissam
0
253
Member Avatar for Christina_4

I am working on an 8 queens problem, I am to place all 8 queens on the board before figuring out if they will attack one another. I am attempting to do this using a 2d array. How do I create random queens (1's) for each row, but making sure …

Member Avatar for JamesCherrill
0
371
Member Avatar for nataraja833

Hello , Can anyone give me an efficient way to do Rect/Polygon filling as below/Attachment . ![Patterns.png](/attachments/small/3/13ab1a68a958648cc9313476241adfb2.png "align-left") ![Patterns.png](/attachments/large/3/13ab1a68a958648cc9313476241adfb2.png "align-center") as of now I'm drawing lines & single pixel rectangles to do this and my application has slowed down so I'm looking for an alternative . This is an extension …

Member Avatar for nataraja833
0
482
Member Avatar for Ahmed_62

i have this code to make sodoko board with 9*9 cells(button cells ) but i cannot made all Jpanels contain my buttons i made the first Jpanel only import java.awt.Color; import java.awt.GridLayout; import java.lang.reflect.Field; import javax.swing.BorderFactory; import javax.swing.JFrame; import javax.swing.JButton; import javax.swing.JPanel; public class Sodoko extends JFrame { private Sodoko() …

Member Avatar for JamesCherrill
0
229
Member Avatar for johnnny

Hello all, Need help with a little assignment in java assignment : user inputs sentence, replaces all lowercase letters in string to uppercase, and vice versa. ive created for (int i = 0; i < s.length(); i++) { if (Character.isUpperCase(s.charAt(i))) { to DETECT if there is an uppercase letter found …

Member Avatar for Lau_1
0
190
Member Avatar for Pallab_2

Hi, can anyone pls help to understand why its throwing class not found error, i am trying to learn how JWS works. i just followed this blog, though every thing looks ok.Attaching the files as well. http://examples.javacodegeeks.com/java-basics/web-start/java-web-start-getting-started/ Pallab

0
119
Member Avatar for Gabriel_7

ok well i just started with Java and i have an assignment that is giving me a hard time what i'm supposed to do is take an entry number(int) and then arrange its digits in an ascending and a descending way, the problem is i don't know much about arrays …

Member Avatar for stultuske
0
234
Member Avatar for sahil.d
Member Avatar for sasikrishnasamy

Hello All, I want to sort my list order by sno. This is my code, List<Employee>list=new ArrayList<Employee>(); Employee class has fields, one of field is sno (its String type); this field values are like this format 1.2.1 1.2.3 1.5.5 1.5.3 I want to sort this serial no. I used comparator …

Member Avatar for 2teez
0
429
Member Avatar for samantha2015

I have a class that implement all my workflow method. At some pointing time, when the request is approved by the workflow, I need to update status in database. For this I need to call the respective service class to save the status. The following method is saving the status …

Member Avatar for samantha2015
0
274
Member Avatar for Alok_5

I want to remove the specific nodes from xml file under song tag whose id =2 from the following file in Android (Java): <music> <song> <id>1</id> <albums_id>1</albums_id> <title>Someone Like You</title> <artist>Adele</artist> <duration>4:47</duration> </song> <song> <id>2</id> <albums_id>1</albums_id> <title>Space Bound</title> <artist>Eminem</artist> <duration>4:38</duration> </song> <song> <id>3</id> <albums_id>1</albums_id> <title>Stranger In Moscow</title> <artist>Michael Jackson</artist> <duration>5:44</duration> …

Member Avatar for Karan_8
0
287
Member Avatar for Ahmed_62

i have these buttons what i wanna do is when i press any of them change the button name to "Ouch!" import java.applet.Applet; import java.awt.Button; import java.awt.Color; import java.awt.Graphics; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; public class sudokou extends Applet { Button num[] = new Button[9]; int x, y, i, j, n …

Member Avatar for JamesCherrill
0
223
Member Avatar for jorwill.harion

Hello! I am new in java and I have this code that will throw an exception if the numerator input is not an integer and will stop the loop process when the user input 'e' as its numerator. Thank you for your help in advance. package org.alibata.training.codes.exceptions; import java.util.InputMismatchException; import …

Member Avatar for JamesCherrill
0
439
Member Avatar for sabeenasyed

Hi.I want to convert telugu text to unicode. please solve my problem. Thankyou --------- sabeena

Member Avatar for rubberman
0
133
Member Avatar for JamesCherrill

I've opened this thread following rotten69's suggestion for "Java projects for beginners". To get things started I've posted a project in a format that makes sense to me; please feel free to follow that format, or to do it in some completely different style if that seems better. Let's see …

Member Avatar for Alok_5
20
3K
Member Avatar for dtpp

Ive been having this issue for quite a long time. When coding in Java my IDE (Eclipse) will not allow me to create JAR file. Ive googled quite alot only to see there is no direct solution to this and the causing factor may be Win8.1. I thought - ok …

Member Avatar for stultuske
0
226
Member Avatar for Ankit_18

import java.util.ArrayList; import java.util.Arrays; import java.util.List; class Counter { public void split(String a,ArrayList<String> al) { char ch[]=a.toCharArray(); int p=0; for(int i=0;i<ch.length;i++) { if(ch[i]==32) {List<String> l=al.subList(p,i); ArrayList<String> al1=new ArrayList<String>(l); //String str=new String[al1.size()]; //al1.toArray(str); //al1.add(str); //al1.add(al1); //why this is also wrong al1.add(al.sublist(p,i)); p=i; System.out.println(al1); } } } public static void main(String... s) …

Member Avatar for stultuske
0
259
Member Avatar for new_2_java

Hello all, I have a function in JS, that I need to translate in Java to be used in my JSP as part of server side script. I need to find out what's the equavalent of JSON.stringify() in Java? This is my current JS function. This functioin takes a CSV …

Member Avatar for peter_budo
0
2K
Member Avatar for rajashree g.s.

1.Take input for boarding place,arriving place and date. 2.Date validation for 120 days(if date is more than 120 days you are not able to book the ticket).if days are less than 120 days then ask for the count of passengers. 3.Take passengers age and gender. 4.If age is less than …

Member Avatar for JamesCherrill
0
387
Member Avatar for Sandeep_13

Hi I am new in java. I am trying to get the stored date in the database and display the same in jdatepicker in frontend. But I failed. Can any one of you suggest how to do the same. Regards Sandeep

Member Avatar for mKorbel
-1
621
Member Avatar for Hsn_1

Hello everybody I'am trying to execute JavaScript in GeckoWebBrowser my code is : Hide Copy Code GeckoWebBrowser1.Navigate("javascript:void(" + TextBox2.Text.Replace("""", """""") + ")")` my JavaScript is : Hide Copy Code var r = confirm("Press a button"); if (r == true) { x = "You pressed OK!"; } else { x = …

Member Avatar for stultuske
0
1K
Member Avatar for Szabi Zsoldos

Hi guys, I've made an application in JavaFX and I do want to export it into a runnable jar. When I run it from Eclipse or Netbeans, it works well. But when I run it from windows as an executable jar I get this error for my layout. Exception in …

Member Avatar for Szabi Zsoldos
0
4K
Member Avatar for Rachna_2

in an examination the grades are given according to the marks obtained. wap in java to display the grades acordingly 80% and above-distinction 60% or more but less than 80%- first divison 45% or more but less than 60%-second division 40% or more but less then 45- pass Less then …

Member Avatar for JamesCherrill
0
171
Member Avatar for paul.deku.50_1
Member Avatar for kapil456
Member Avatar for skaa

I need to use Drools 6.2.0.Final. Is it possible to use Guvnor with it? Any example? Thank you.

Member Avatar for rproffitt
0
206
Member Avatar for mama12

I want to find min in o(1) and each time min is called min should be deleted static ArrayList <Integer> numbers = new ArrayList <Integer> (); static ArrayList <Integer> min = new ArrayList <Integer> (); public static void add(int num){ numbers.add(num); if(min.isEmpty() || num < min.get(min.size()-1)) min.add(num); } public static …

Member Avatar for JamesCherrill
0
136
Member Avatar for Saidivya

Hi, I want to edit the file in the following way My Sample File: 101 273970116 2719674681506161941D094101METABANK WAVECREST 5220Taxi Charger Micro Deposit - Cr A271967468WEBP2P 150616 1273970110000001 6220110000156534057672 0000000007GreenGrP2C386daTest User S 0273970110000001 6220110000156534057672 0000000005ClarkGrP2C386dcTest User S 0273970110000002 82200000020002200002000000000000000000000012A271967468 273970110000001 9000001000001000000020002200002000000000000000000000012 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 In the above file, wherever if …

Member Avatar for JamesCherrill
0
174
Member Avatar for Michael_43

I am trying to validate if this is a BST or not and return a true or false. I believe I have the code right but i cannot get it to print properly if I could get any help how to fix my problem it would be greatly appreciated. Test …

0
160

The End.