35,586 Topics
| |
Hey guys! So I'm writing a code that takes 10 numbers from the user which is stored in a array. The user then inputs the problem number (1 or 2) depending on what they want to do to the array. Unfortunately, I'm getting and error on line `array[i].prob1(); `.. Here's … | |
Hi, I jus want to ask why is it that the pacman will move but it will get larger when it is painted..also is that the proper way to draw?. here is the code import javax.swing.*; import java.awt.*; public class Mypacman extends JFrame implements Runnable{ int x; public Mypacman(){ setVisible(true); … | |
Hello, I need to make a script that will generate a spiral html table.. user should be able to enter number of rows and columns... and a spiral should appear... and I havent a clue... can someone give me some hints? some ideas? PLEASE! thanks | |
I want to save selected text file as html file i have written following code JFrame parentFrame = new JFrame(); JFileChooser fileChooser = new JFileChooser(); fileChooser.setSelectedFile(f12); fileChooser.setDialogTitle("Specify a file to save"); int userSelection = fileChooser.showSaveDialog(parentFrame); if (userSelection == JFileChooser.APPROVE_OPTION) { File fileToSave = fileChooser.getSelectedFile(); System.out.println("Save as file: " + fileToSave.getAbsolutePath()); … | |
How can I keep track of the unguessed letters yet in my JTextArea? In the non gui version I used an arraylist, worked fine but should I leave the arraylist and use it to track unguessed caracters ? The method is still console based, just started implementing the gui made … | |
I was trying to figure out how to insert pictures into Java, but as music in the background plays, the pictures alternate. It would be really great if someone could include the music code too. Thanks for any help in advance. | |
Hi Everyone, Can I ask your assistance how to integrate the AMBRA platform in Tomcat? "Ambra is an innovative Open Source platform for publishing Open Access research articles. Architecture Features Ambra is written in Java." Actually, done for installation in tomcat but the Ambra is the next, but how? Regards, … | |
OK, I have been experimenting around with GridBagLayout and I'm getting the hang of it. Things are looking the way I want them to on the INITIAL drawing of the GUI. However, when I RESIZE the JFrame to make it smaller vertically, at a certain point, the proportions get skewed. … | |
| I'm trying to create a .txt reader and inserting the read data to the cleansheets software we are editing in class but instead of putting the correct data it does nothing. I made some prints and this is what I obtain: D:\Documentos\Desktop\ImportTest.txt cacacaca ----- [[Ljava.lang.String;@73a175] cacacaca ----- [[Ljava.lang.String;@73a175, [Ljava.lang.String;@364cf2] cacacaca … |
i can not understanding the error of this program interface Test { void show(); void input(); void square(); } class Run implements Test { int a,b,c; void show() { System.out.println("a = " + a); System.out.println("b = " + b); System.out.println("c = " + c); } void input() { a=2; b=3; … | |
I had Developed a software in java. Need to update the software occasionally.How to update it with notification. | |
Well, the title says it all. Imagine that I have HelloWorld.java , I want to create an executable jar from it. I know that if I use IDE such as eclipse I can create it there but how can you create it without that? | |
Please help. I wrote a quicksort with a median of either 3 or 5 to be the pivot and I can not figure out, for the life of me, why my code won't run. If the boolean isMedOf3 is true, then the partition uses a median of 3 to choose … | |
i have a problem with code below import javax.swing.*; class HelloWorld { public static void main(String x[]) { JOptionPane.showMessageDilog(null,"Welcome","Bscs",1); } } i try my best but i can not understand the following error HelloWorld.java:5: error: cannot find symbol JOptionPane.showMessageDiloge(null,"Welcome","Bscs",1); ^ symbol: method showMessageDiloge(<null>,String,String,int) location: class JOptionPane 1 error plz help … | |
Hi everyone, this is my first post here. I am new to Java. I understand it when I see it, but writting it is difficult for me. That is for now. I am building an app, which is going to be a quiz. There are 10 questions with fur answers … | |
How is it possible that if I type A in a textfield, that is added to String variable which is empty and I can then pass that string as a argument to a textfield for display what I typed. for example: String letter2=""; if(ke.getKeyCode()==KeyEvent.VK_A) letter2=letter2+"a"; btextfield.setText(letter2); | |
I have assigned to create a multichat application that require to public message to all client, private message to certain client and show the user list, anyone can tell me which part should i do to implement private msg and online user list (where will show the name after client … | |
postfix and prefix increment or decrement operators very very confusing for me i try my best but i can not understand the basic different between them plz help me i know The prefix form first performs the increment operation and then returns the value of the increment operation. The postfix … | |
I have 2 drop down. In 2nd drop down items are added dynamically based on 1st drop down selection. Now I want selected value of 5th subject to store in MySQL table. I am not able to get the value of option which is selected in 2nd drop down. How … | |
Some time ago, I wrote some code, which uses DFS to find whether there is a path from a source vertex to a destination vertex. However, I am thinking now what if there is more than 1 possible way? What comes to my mind is save paths in an ArrayList … | |
**Sudoku Solver** I am writing a program to solve Sudoku Puzzles. This thread will contatin my progress throughout the project and hold any questions and replies. | |
what is command line argument in java and how it is work public static void main(String []args){ for (int i = 0; i < args.length; i++) System.out.println(args[i]); and what is .length in upper code. is it function no it is not function is it class no it is not a … | |
hi guys, hope you are doing very well. I've been working on a program that if I enter lowercase letters in one textField the other should display it in capital letters with the help of Event Handling but I am constantly getting these two errors. I'm a beginner so would … | |
I am trying to build a java program for user login but I am not sure if my MVC design is accurate. I have the following classes: LoginControl - servlet LoginBean - data holder java class with private variables getters and setters LoginDAO - concrete java class where I am … | |
Hello, I am trying to receive the documenttext of a web browser after the user has clicked a javascript button which loads more information on to the page. Instead of getting the new code, it simply gives the original code which was given once the page was loaded. Any help … | |
Hello guys, How to Eliminate ifs and elses using polymorphism, so that the code is more compact and easy to understand. public void update( ){ // is its dead it does nothing if( dead ) return; // see what movement it is doing int dy = rising? -6: 6; if( … | |
Hello all, I am working on assignment for class and I thought I had this one but something is wrong. This is an inventory control program that needs to display 7 items with the item number, name, number in stock, price and value. The program works for item 7 but … | |
I'm trying to set a time limit of like 2 mins after time of a click event. How can I achieve this? Most of the countdown timers I see all over the internet are countdowns to dates like Aug 23, 2015 | |
The system is able to find grade for each course based on final marks, calculate GPA, Calculate CGPA. Methods (menu); i. Input matric_number, name, coursecode, credithours, semester, final marks for each subject. You may use text file ii. Calculate GPA and CGPA for each student. iii. Search a student record … |
The End.