32,204 Topics
| |
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; … | |
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 … | |
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 … | |
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 … | |
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() … | |
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 … | |
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 | |
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 … | |
Hi All need discussion upon server application | |
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 … | |
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 … | |
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> … | |
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 … | |
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 … | |
Hi.I want to convert telugu text to unicode. please solve my problem. Thankyou --------- sabeena | |
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 … | |
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 … | |
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) … | |
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 … | |
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 … | |
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 | |
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 = … | |
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 … | |
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 … | |
Hi please i like to know how emails are send using java.Thanks | |
I need to use Drools 6.2.0.Final. Is it possible to use Guvnor with it? Any example? Thank you. | |
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 … | |
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 … | |
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 … |
The End.