32,199 Topics
| |
How can I programatically and accurately detect the touch/slide made by a user's touch on an android phone? I want this to be used as suppose I have two android devices synced with each other. Both of them have anything opened suppose pdf file, music file video file. Then if … | |
Hey there! I am a new student that wants to be a GOAT of Developing, I don't know anything about Java. But by watching I downloaded Eclipse IDE for Java Developers but don't know how does it work :D I have also downloaded Java Program or Files from http://www.java.com/ Can … | |
I am getting the following exception when I am running my Swing Application. But the program continues and does not terminate abruptly unlike general Exceptions Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at javax.swing.plaf.basic.BasicTreeUI.paintRow(BasicTreeUI.java:1399) at javax.swing.plaf.basic.BasicTreeUI.paint(BasicTreeUI.java:1189) at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142) at javax.swing.JComponent.paintComponent(JComponent.java:742) at javax.swing.JComponent.paint(JComponent.java:1005) at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4963) at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4916) at javax.swing.JComponent._paintImmediately(JComponent.java:4859) at javax.swing.JComponent.paintImmediately(JComponent.java:4666) at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:451) … | |
I am trying to read lines of input from a BufferedReader and output them in sorted order without any duplicate lines. I think that using a TreeSet would be my best option. Unfortunately I don't know how to get my input from the BufferedReader into the TreeSet. This is what … | |
How to write a method in Java to compute the 'Letter Grade' given a percentage number grade. Method signature: public String checkRange(int grade) | |
I have a class (Point2D), and an instance variable (double tav) in this class. I would like to compare different Point2D objects (based on variable "tav") by the relational operators (<,>). (a < b) means that (a.tav < b.tav). Is there any way to solve this problem? public class Point2D … | |
Is it mandatory to handle an exception that is thrown using the `throw` keyword? If so is there a separate rule for Checked and Unchecked Exception, as in who should be mandatorily caught? public void met() { throw new ArithmeticException | |
Hi I just completed my database hospital application and now i'm ready to export it into a JAR file. I palced the DB in the classes subfolder and played with ClassLoader but got nothing! I used the following code String driver = "sun.jdbc.odbc.JdbcOdbcDriver"; String url="jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=f:hospitalDb.mdb;}"; any idea … | |
int wordpercent = ((count/totalwords)*100); JOptionPane.showMessageDialog(null, "Count: " + count); JOptionPane.showMessageDialog(null, "Words: " + totalwords); JOptionPane.showMessageDialog(null, "Character Count: " + length); JOptionPane.showMessageDialog(null, previousletter); JOptionPane.showMessageDialog(null, nextletter ); JOptionPane.showMessageDialog(null, "Your word makes up " + wordpercent + "% of the document"); This is the final part of my program code. The program lets … | |
Hi, can someone help me about this problem or suggest some pseudocode? if i input this numbers 12 ,24, 100 output should be YES, YES, YES i'm confused in writing the solution in code. | |
Hello, I want to implement Change Listener in the Action Listener of a Button I have a color graph chooser and 2 buttons...Apply and Cancel to select the color of the color chooser i have implemented the Change Listener but I want the change listener to act on the Apply … | |
| I got a problem in a program I'm working on here: String[ ][ ] applicant = new String[appno][2]; for (i = 0; i < applicant.length; i++){ System.out.println("Input applicant's name: "); appname = keyboard.nextLine(); applicant[i][0] = appname; System.out.println("Input applicant's position: "); apppos = keyboard.nextLine(); applicant[i][1] = apppos; } The input works, … |
Hello. I'm trying to make my first java executable file. My Java project imports images from a different directory, and uses them. After I make the executable file (through Export in Eclipse) and I delete the directory of images, the executable doesn't show the images. How can I make the … | |
int [] ia1 = {1,2,3}; int [][] ia2; Object o = ia1; ia2 = new int [3][3]; ia2[0] = (int[])o; ia2[0][0] = (int[])o; Answer is "Compilation fails in last line" Explanation: Arrays are objects, and that each array dimension is a separate type. So, for instance, ia2 is of type … | |
public class NewClass { public static void main(String[]args){ int beerNUM = 99; String word = "bottles"; while (beerNum>0){ if (beerNum == 1){ word = "bottles"; } System.out.println(beerNum + " " + word + "of beer on the wall"); System.out.println(beerNum + " " + word + "of beer."); System.out.println("take one down"); … | |
Hi guys, I tried to get each line of the text file and convert it to SHA-1 formart then to binary but i could not get the output when i tried to do system.out.println the code: package hash; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.Formatter; import java.io.*; import java.security.DigestInputStream; import java.util.logging.Level; … | |
How to compare a value which is taken from JTextField with the database value??? | |
Hi, My database is showing null value when I try to insert the file path I upload. protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); String name=request.getParameter("fileUpload"); String destPath = ""; String relativeDestPath=getServletContext().getRealPath(destPath); System.out.println("Relativepath is"+relativeDestPath); PrintWriter out = response.getWriter(); String fileName=name.substring(name.lastIndexOf("\\")); String pathName=name.substring(0,name.lastIndexOf("\\")); String destName = relativeDestPath+fileName; … | |
I'm trying to learn how to write code in order to find the average of numbers I enter in my program, as well as every time I enter a number it records how many I have typed in, and finally the sum of all the numbers I have entered each … | |
Hi guys, I'm a real beginner at using Java, it's taking me almost all day to get what I've put together so far, but I'm having a real hard time getting it to print out the average, total, and count when I run my code and input my numbers, Here's … | |
Please am a final year student in a university studying Bsc Information technology. am about to start my final year project and i need some titles, please feel free to suggest any title, weather it a project you have done before or not, please i need your support to select … | |
can any one help with to design a recursive algorithm to compute the integer part of lgn using only addition and integer division. | |
| 1 1 2 1 1 3 3 1 1 4 6 4 1 how can i get this output? plz give me answer |
please can you help me with the java code to grade students using if...else statements. | |
In the java policy file what will happen if we comment out //permission java.lang.RuntimePermission "stopThread";. My understanding is that we can't call thread.stop() anywhere in the program am i rite? If we call it should say "Access denied"... If any Text area is built with AWT closing it by clicking … | |
I have created a form in netbeans with two radio buttons in a button group with a text box. Box 1 = Yes Box 2 = No when form loads no is already selected. I want the text box to be ivisible until user selects yes. but everything I have … | |
import java.io.File; import java.util.Scanner; import javax.swing.JFileChooser; import javax.swing.JOptionPane; import javax.swing.UIManager; public class TextAnalysis { public static void main(String[] args) throws Exception { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); JFileChooser chooser = new JFileChooser("c:/users/zachary/demo"); int outcome = chooser.showOpenDialog(null); if (outcome == JFileChooser.APPROVE_OPTION) { File f = chooser.getSelectedFile(); Scanner words = new Scanner(f); String word = JOptionPane.showInputDialog("Enter … | |
can u give me a simple java mini system,,,plss...for my project po kc penge nlang dn po ng output at codes | |
This is the problem I am suppose to solve: A mail order house sells six different products whose retail prices are as follows: Product 1, $3.75; Product 2, $5.95; Product 3, $8.75; Product 4, $6.92; Product 5, $8.75; Product 6, $7.87. Write an application program that reads a series of … | |
All, I usually write console apps, but now I have to do a forms app. Hopefully that will explain the sillyness of the following question: I created my project in NetBeans and NetBeans automatically generated a class with the project name, and this class has a main() method. Then I … |
The End.