32,204 Topics
| |
Hello everyone, I'm new here, and reletively terrible at coding, so I was hoping I could get some assistance with a program I've been working on. My assignment is to create a Frame that allows the user to choose where to paint a circle using a horizontal and vertical scroll … | |
expandable JPanel while adding items Hi, I have a JFrame and I added JPanel inside it However, I designed in a way, I can add JButton to that panel it is used as a bookshelf for example btn 1 btn2 btn3 so each time i add, it goes three columns … | |
I am fairly new to Java programming and I am having problems with creating a program with these requirements: 1. Create a program to simulate the roll of 2 – six sided dice. 2. Test to see if the dice are equal. 3a. If they are equal print “You win! … | |
Hello all, I am a beginner at Java and taking a class which is moving at a fast pace. So I have this Animal class and Fox class that must access the AnimalColor class through an API. Originally the AnimalColor object in the Animal class was public(accessible by all) but … | |
import java.util.*; public class GenericDemo4 { public static void main(String r[]) { Set s1 = new HashSet(); s1.add(0); s1.add("1"); dostuff(s1); } static void dostuff(Set<Number> s) { do2(s); Iterator i = s.iterator(); while(i.hasNext()) System.out.println(i.next() + " "); Object [] oa = s.toArray(); for(int x = 0; x<oa.length; x++) System.out.println(oa[x] + " … | |
class Sample1 { Sample1() {System.out.println("Sample1 const"); } void doStuff(){System.out.println("sample1 dostuff"); } } class Sample2 extends Sample1 { Sample2() {System.out.println("Sample2 const"); } } public class Sample3 extends Sample2 { Sample3() {System.out.println("Sample3 const"); } public static void main(String r[]) { new Sample3().go(); } void go() { super.doStuff(); } } The output is: … | |
hi all, been tryin to find wat is wrong with this code. It works for sometime then starts repeating the same value continuossssssly. any help will be appreciated. thanks /* THIS PROGRAM IS TO RUN A SIMULATION PROGRAM OF ARRIVAL AND SERVICE TIMES OF AN AUTO-REPAIR WORKSHOP * servTime = … | |
Hi, i want to call frame B from Frame A private void BFrameBActionPerformed(java.awt.event.ActionEvent evt) { Frame B = new Frame B.setVisible(true); } NOTE :calling JframeB is trigerred by a jButton but when I do this FrameA overlays my Frame B. can someone help me with this? | |
Hello , i am starting with java. I need to school make program that generates random numbers 1-20 , a than make method to check duplicates and replace them ... i find on the internet only methods with array or something like that , i cant use that because i … | |
Use document.forms[0].submit(); (0 refers to the index of the form – if you have more than one form in a page, then the first one has the index 0, second has index 1 and so on). | |
When choosing the input file, I tried three ways & all of them generated errors ! I created the file.txt in the project's folder. I'm using Netbeans IDE. 1) Passing java ShowFile Input.text as a command-line argument [properties ---> run ---> wrote this command-line in the 'Argument' box] 2) Using … | |
I'm trying to alphabetize an array by comparing the characters at position 0 of two strings in an array, but I don't understand why when the if statement doesn't run my trail variable doesn't get incremented. //alphabetize array public class AlphaArray { public static void main(String[] args) { String[] yourChoiceItems … | |
Hi, how is it possible to handle multiple keys at same time. I am making platformer game. Now if I push forward it goes forward until I release button or hit some else button example jump. What should I do to achieve that it wouldnt stop going forward but jumps … | |
public class BufferedReader { public static void main(String[] args) throws IOException { char c; BufferedReader sen = new BufferedReader (new InputStreamReader(System.in)); **// ERROR** System.out.println("Enter characters, 'q' to quit"); // read characters from the console while(c != 'q') { c = (char) sen.read(); **// ERROR** System.out.print(c); } } } I don't … | |
I created a java web service in netbeans successfully.Then i deployed it also.But i can't right click on web service and test it.Test option appear as unclickable.Please help me. | |
Hi, I've been making my own zelda like rpg game and the game runs actually fine, but when closing it console prints this: FATAL ERROR in native method: JDWP Can't allocate jvmti memory, jvmtiError=JVMTI_ERROR_INVALID_ENVIRONMENT(116) JDWP exit error JVMTI_ERROR_WRONG_PHASE(112): on getting class status [../../../src/share/back/util.c:1265] JDWP exit error JVMTI_ERROR_INVALID_ENVIRONMENT(116): Can't allocate jvmti … | |
<style name="Theme.Custom" parent="android:Theme"> <item name="android:windowBackground">@drawable/progress_clip_drawable</item> <item name="android:windowNoTitle">true</item> </style> if I use image drawable it works but if I use clip or shape drawable it want please help suggest solution | |
i have a udp server thats going to send and mp3 file. when does the client udp know when the udpserver is done sending? | |
I am trying to figure out how to distiguish if the user input was a string or a int. The out put i am looking for is please enter a string: cat please enter a string: dog please enter a string: hamster please enter a string: 1234 please enter a … | |
public String roll() { Random generate = new Random(); int diceRoll; int firstNum; int secondNum; boolean winner = false; for (int x=1; x<=3; x++) { firstNum = generate.nextInt(6)+1; secondNum = generate.nextInt(6)+1; diceRoll = firstNum + secondNum; System.out.println("Roll number " + x + " was " + diceRoll); if(userNum == diceRoll) … | |
I am just starting out with java and I have to make a decision based text game. I keep getting some errors and I feel like I am missing an else or some curly braces somewhere, any help? import java.util.*; public class TextGame { Scanner scan = new Scanner(System.in); int … | |
Hi, [CODE] public void getTasksList(ArrayList<PerformTask> TasksList) { // TODO Auto-generated method stub try{ Class.forName("com.mysql.jdbc.Driver"); Connection cn=DriverManager.getConnection("jdbc:mysql:///test","root", "admin"); Statement st= cn.createStatement(); String s1 = "Select * from perform_task"; ResultSet rs = st.executeQuery(s1); System.out.println("Comes Here !! "); while(rs.next()){ rs.getDate("DateOfTask"); java.util.Date jDate = new java.util.Date(rs.getDate("DateOfTask").getTime()); TasksList.add(new PerformTask(rs.getInt("TaskID"), rs.getInt("PersonID") , jDate ,rs.getString("TaskDescription"),rs.getInt("TotalEffort"),rs.getString("TaskName"))); } }catch(Exception … | |
1.Which of the expressions below is true if and only if an array A containing three different integers is sorted in ascending order a. A[1] < A[2] || A[2] < A[3] b. A[0] < A[1] && A[1] < A[2] c. A[0] < A[1] || A[1] < A[2] d. A[1] < … | |
I have installed jdk and eclipse. but I can't start progamming. When I start from menu> New> class, it shows at the top "Source folder name is empty." Can anyone help me? My operating system is win7 64bit | |
Working with polymorphism collections, list, arraylists etc. I have a sorted collection that I would like to split based on one of the objects properties. All records > 0 to one; all less than to another. I'm trying to think of the best way to implement this. I'm thinking Comparable/Comparator … | |
Hi I need help with this program. I am trying to get it to store the person data into an array list and read from a file text but have not been able to figure out how to due it. This are the instructions for the program: Write an AddressBook … | |
I'm using Netbeans 7, JEE project with application client, stateless ejb with remote interface, and JPA entity clasess made from sql script. Interfaces are in separate library project which is referenced in ejb and client project. **And the problem is the remote method that use custom interface object made from … | |
dear all, I have made one program, but i am stuck with one problem. I have taken one scrollpane in simple desktop GUI application in java. My hierarchy of Scroll pane is as below. JFrame |_JTabeedPane |_JScrollPane |_JPanelMain |_Jpanel |_JPanelA |_JPanelB Now all the components are in JPanelA and JPanelB. … | |
I've created combobox.. the user have to select from the combo class, subject or grade(A,B,C,D,F) if the user select class in the text field he should type wich class 7 grade or8grade or 9 grade if he type 7 he should get all of the student name, grade. how can … | |
Hi all - this is the code: package sodukupackage; import java.util.Scanner; import java.io.File; import java.io.FileNotFoundException; public class ReadSudokuValuesIntoArray { public static void main(String[] args){ int[][] sudoku = new int[9][9]; Scanner sc = null; try{ int i = 0, j = 0, count = 1; sc = new Scanner(new File("validsudoku.txt")); while … |
The End.