32,204 Topics
| |
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 … | |
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. | |
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; … | |
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 … | |
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 … | |
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 … |
The End.