32,204 Topics

Member Avatar for
Member Avatar for Andyjava

Hello all. public class LoginFragmentActivity extends SherlockFragment { EditText e1 = null; EditText e2 = null; Button b; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInatanceState) { View view = inflater.inflate(R.layout.login_layout, container, false); e1 = (EditText) view.findViewById(R.id.reg_email); e2 = (EditText) view.findViewById(R.id.reg_password); b = (Button) view.findViewById(R.id.btnLogin); b.setOnClickListener(new View.OnClickListener() { @Override …

Member Avatar for Andyjava
0
120
Member Avatar for connoisseur2010

Good day guys, I'm a java EE developer. I'm to do my final year project in java EE but have no idea of something tangible to earn me a good grade. Any suggestions. Would love to get a feedback by the end of the day. Thanks.

Member Avatar for peter_budo
0
197
Member Avatar for jimmyjhonrubio

import java.util.Scanner; // Needed for the scanner class /** Chapter 2 Programming Challenge */ public class Wordgame { public static void main(String[] args) { String name; //The user's name String age; //The user's age String city; //The name of a city String College; //The name of a college String Profession; …

Member Avatar for JamesCherrill
0
207
Member Avatar for cisumma

Hello I am using Apache derby embedded database: I have been using a system to display records from the database described in "DisplayInstructorAvailableNowJTable.java". it allows the result set to create a model from a prepared statement. I have only uncovered the tip of the iceberg concerning JTABLE. I am not …

0
137
Member Avatar for WDrago

All, I am working on my first forms app (using NetBeans). I don't like to mix GUI code with app code, so I have my main class, GUI class and core code class nicely seperated. When the user clicks a button on the GUI form it calls a method in …

Member Avatar for WDrago
0
214
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
98
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
352
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
180
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
244
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

The End.