32,199 Topics
| |
[CODE] public void mouseClicked(MouseEvent e) { store clickedStore = null; for (int i = 0; i < stores.length; i++) { if (stores[i].isClicked(e.getX(), e.getY())) { clickedStore = stores[i]; break; } } } [/CODE] Is it possible to display the result of the above loop as a string? I have tried various … | |
plzz help me........... i want to list all the sub directories,files(including subdirectory files) in a particular drive(C,D,E,etc). | |
I keep getting a"Can't find symbol" error and code will not compile. Assignment already late and need help ASAP. [CODE]//Inventory Program Part 3 //IT215 week 6 class Inventory { String itemNumber; //stores item number String name; //stores name int stockQuantity; //stores quanity in stock double pricePerunit; //stores price String departmentName;//Department … | |
Hi, I am having a problem in using radio checkbox to change the color of a graph. The main Idea was to add checkboxes to a graph and also add different shapes to the graph code which was given. The code I tried is the following : [code]import java.applet.*; import … | |
Hi guys, I really need some help with this, I've spent hours looking for a solution. I have 4 classes of which 2 are important right now. 1. The user enters his username in the JTextField userF, if I print that userF.getText() in the class where userF is created I … | |
i creeat a jar file,i used system.out.println to display records on screen.but the problem when i click on jar file nothing is displayed.it is displayed only when i am opening command prompt and entering java name of file.so result is displayed on console (msdos) but i want result to be … | |
[code]public class Test { public static method1(int n, m){ n += m; method2(3.4); } public static int method2(int n){ if (n > 0)return 1; else if (n == 0) return 0; else if (n < 0) return -1; } }[/code] | |
[CODE]public static Integer calcs(String postFix) { StackInterface<Character> stack = new LinkedStack<Character>(); // instantiate Character stack Integer result = new Integer(0); Node<Integer> num1, num2; Integer int1 = new Integer(0); // declare address to each variable object Integer int2 = new Integer(0); num1 = new Node<Integer>(int1, null); num2 = new Node<Integer>(int2, null); … | |
Hello, Is it possible for anyone to explain to me what "Initialize the 3 parallel arrays" means? Here is the problem. A file called seats.txt contains a description of an airline seating arrangement and a list of individual seat assignments. An example is shown here: rows 7 leftSeats 1 rightSeats … | |
[code] import java.awt.*; import java.awt.event.*; import java.sql.*; import javax.swing.*; import java.util.*; public class attendance extends JFrame implements ItemListener, ActionListener { static Connection con; static Statement stmt; static ResultSet rs; static ResultSetMetaData rsMeta; String query; String ref="",rollno=""; String[] heads; int[] stChange; String[][] cubeData; int rows, cols, coo; public attendance(String tit, String … | |
Dear All I am a newbie Java Learner.I try to learn over Java API Docs.But still I need some help. I have a gui which consist of four textfields(tf1,tf2,tf3,tf4) and a button(b1). If I press the button(b1)"Register", I want my action write whole textfield sources into a text.txt file by … | |
Hai, I am new java developer. Now i am doing one struts application. In my application, at the User registration time, i need to Encrypt the password field and then i like to store into the database. After that the same user will be logging, at the moment the database … | |
Hi! The problem is connected with using frame.pack(). So, let's say there is JFrame: frame. Depending on the option selected from JComboBox, the content and size of JFrame should change. Everything works perfectly in NetBeans (!!!). However, if I try to run the JAR file, then the size of JFrame … | |
Hello, I am trying to create an IRC server. The thing is that I dont want this server to run on "localhost", I want to connect this server to other upstream IRC servers. I dont know how to do that. I.E. I want this server to connect to smth.hostname.com on … | |
I wrote a simple HelloWorld programe looks like something this: import javax.swing.JOptionPane; public class HelloWorld { public static void main(String [] args) { JOptionPane.showMessageDialog(null, "Welcome"); } } ----------------------------------------------------------- In this simple java programe which in not an applet I just want to print the "Welcome" message in some other fonts … | |
My code is : [CODE] public final class Pixels{ BufferedImage img=null; public int w,h; public Pixels(){ try { // Read from a file File file = new File("1.jpg"); img = javax.imageio.ImageIO.read(file); } catch (IOException e) { } } public void checkfunction(){ h=img.getHeight(); // errorpoint w=img.getWidth(); } [/CODE] Errors: Exception in … | |
I'm trying to implement a gap sort which is a bubble sort that instead of comparing neighboring elements to sort a list, it compares elements 'i' positions apart. I can get the sort to execute the loop once, but I can't figure out how to make my program continue looping … | |
| Hi I wrote a litle code to calculate factorial, but when I compile it, it says " ';' expected " (In the " for ") Here is my code : [CODE] /** * A class to calculate factorial of a number * * @author Barth * @version 10/29/10 */ public … |
HTTP Status 500 - -------------------------------------------------------------------------------- type Exception report message description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException: File "/WEB-INF/struts-html.tld" not found org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51) org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409) org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116) org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:160) org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:430) org.apache.jasper.compiler.Parser.parseDirective(Parser.java:499) org.apache.jasper.compiler.Parser.parseElements(Parser.java:1558) org.apache.jasper.compiler.Parser.parse(Parser.java:130) org.apache.jasper.compiler.ParserController.doParse(ParserController.java:245) org.apache.jasper.compiler.ParserController.parse(ParserController.java:101) org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:176) org.apache.jasper.compiler.Compiler.compile(Compiler.java:317) org.apache.jasper.compiler.Compiler.compile(Compiler.java:298) org.apache.jasper.compiler.Compiler.compile(Compiler.java:286) org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:565) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:309) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) note … | |
HTTP STATUS 500 PLEASE HELP ME description The server encountered an internal error () that prevented it from fulfilling this request. exception org.apache.jasper.JasperException org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root cause java.lang.NullPointerException org.apache.jsp.janki.bsal_005fsearchresult_jsp._jspService(bsal_005fsearchresult_jsp.java:107) org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324) org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292) org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) note The full stack trace of the root cause is available in the … | |
[CODE=JAVA] setFoo(getFoo() + 1); ... private int foo; public synchronized int getFoo() { return foo; } public synchronized void setFoo(int f) { foo = f; } [/CODE] Easy code for a race condition. Easy solution: [CODE=JAVA] synchronize(o){ o.setFoo(o.getFoo() + 1); } ... private int foo; public synchronized int getFoo() { … | |
I have wrote a simple java programe whose code is as fallow: [code] import javax.swing.JOptionPane; public class HelloWorld { public static void main(String [] args) { JOptionPane.showMessageDialog(null, "Welcome"); } } [/code] ------------------------------------------------------ Now I just want that the message "Welcome" to print in differnet size and color. Please help me … | |
i want to make my java project with Jmonkey, is it easier than using eclipse alone? | |
I want to create payslip in java [CODE]public Vector createData() { Vector result = new Vector(); Vector rec = new Vector(); Object[] value = new Object[] {"Employee Name",ename.getSelectedItem().toString()}; rec.add(value); value = new Object[] {"Mary-Kate Olsen", "Ashley Olsen"}; rec.add(value); result.add(rec); rec = new Vector(); value = new Object[] {"Charlie Read", "Craig … | |
[B][COLOR="Red"]guys help me if these code is correct [/COLOR][/B] [CODE=java]import javax.swing.*; import java.awt.event.*; public class SampleCalc extends JFrame implements ActionListener{ JTextField txtNum1 = new JTextField(); JTextField txtNum2 = new JTextField(); JButton btnAdd = new JButton("+"); JButton btnSub = new JButton("-"); JButton btnMul = new JButton("*"); JButton btnDiv = new JButton("/"); … | |
hey everybody! I want to create a program that counts the number of each word in a sentence given by the user. but I dont know how it is. pls help me... | |
Just a heads up, I posted this same question on Dream in code over 2 hours ago and nobody has answered. The link is [URL="http://www.dreamincode.net/forums/topic/197275-checking-for-multiple-keys-pressed/page__p__1153044__fromsearch__1&#entry1153044"]http://www.dreamincode.net/forums/topic/197275-checking-for-multiple-keys-pressed/page__p__1153044__fromsearch__1&#entry1153044[/URL] I have been trying to figure out how to increment or decrement a value if two keys are pressed at the same time (ctrl+, ctrl-). … | |
Hello! I would like to be able to change the sequence of rows in the JTable by clicking on arrows, which will be placed on the right side of the JTable. Please, see an attached file to understand the idea. Well, could someone please give me some advices on how … | |
Hi guys first off i want to say i really enjoy this forum i just signed up but i have referenced it before. so i have a question i need help with. here is the task at hand [QUOTE]A file called [URL="http://www.cs.oswego.edu/~odendahl/coursework/csc212/201009/assignments/03/tables.txt"]tables.txt[/URL] contains ranges that describe multiplication tables. Each line … | |
I want into values into databas using java code...so send me the sample codes on that senarios using javacode i want to insert values into database ...give an idea to impletement |
The End.