32,199 Topics

Member Avatar for
Member Avatar for mIND.dEcEpToR

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 …

1
97
Member Avatar for Dev.Waleed

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 …

Member Avatar for stultuske
0
232
Member Avatar for hemanth.balaji

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) …

Member Avatar for JamesCherrill
0
756
Member Avatar for sarah.mathieson.7

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 …

Member Avatar for NormR1
0
351
Member Avatar for nitigya

How to write a method in Java to compute the 'Letter Grade' given a percentage number grade. Method signature: public String checkRange(int grade)

Member Avatar for JamesCherrill
0
44
Member Avatar for Tomi1988

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 …

Member Avatar for JamesCherrill
0
137
Member Avatar for rahul.ch

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

Member Avatar for stultuske
0
178
Member Avatar for ringo_tech

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 …

Member Avatar for ringo_tech
0
295
Member Avatar for ctclements

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 …

Member Avatar for ctclements
0
203
Member Avatar for gelmi

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.

Member Avatar for NormR1
0
136
Member Avatar for poojavb

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 …

Member Avatar for poojavb
0
567
Member Avatar for ragnacrap

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, …

Member Avatar for NormR1
0
143
Member Avatar for thompsonSensibl

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 …

Member Avatar for stultuske
0
194
Member Avatar for rahul.ch

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 …

Member Avatar for stultuske
0
211
Member Avatar for rishabh.sahay.5

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"); …

Member Avatar for stultuske
0
108
Member Avatar for drogba123

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; …

Member Avatar for drogba123
0
464
Member Avatar for navya.shalini

How to compare a value which is taken from JTextField with the database value???

Member Avatar for navyashalini
0
71
Member Avatar for newcoder310

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; …

Member Avatar for newcoder310
0
114
Member Avatar for minimee120

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 …

Member Avatar for NormR1
0
242
Member Avatar for minimee120

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 …

Member Avatar for minimee120
0
164
Member Avatar for beholdafrica

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 …

Member Avatar for stultuske
0
167
Member Avatar for jury

can any one help with to design a recursive algorithm to compute the integer part of lgn using only addition and integer division.

Member Avatar for NormR1
0
45
Member Avatar for kinjal.shukla.77
Member Avatar for stultuske
0
79
Member Avatar for adudarko.kingsley

please can you help me with the java code to grade students using if...else statements.

Member Avatar for JamesCherrill
0
41
Member Avatar for av11453

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 …

Member Avatar for NormR1
0
331
Member Avatar for WvTxMan_1

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 …

Member Avatar for JamesCherrill
0
200
Member Avatar for ctclements

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 …

Member Avatar for Majestics
0
2K
Member Avatar for keithlouie.manalon

can u give me a simple java mini system,,,plss...for my project po kc penge nlang dn po ng output at codes

Member Avatar for JamesCherrill
0
38
Member Avatar for nmahmood630

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 …

Member Avatar for nmahmood630
0
1K
Member Avatar for WDrago

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 …

Member Avatar for WDrago
0
930

The End.