32,199 Topics
| |
hi, I have a problem with my JTable it displays the same line at all lignes,my code consists to use a command that will be run in background (using the command exec.getRuntime ()), and this will return multiple rows for that, I used a variable "i" to initialize lines and … | |
Hi, I'm having some problems with my program and I'm not sure how to fix them. I have a main method that starts out with a frame. [CODE]public class Cryptography { public static void main(String[] args) { CryptoMainMenu mainMenu = new CryptoMainMenu(); JFrame frame = new JFrame("Cryptography"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(mainMenu); frame.pack(); … | |
Hi everybody, Tryed to make this program: Simple browser: you type the URL at the top and then get a new window with this web page. But my output is just JFrame(Even color did not get changed) help me please to find the problem. [CODE]import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; … | |
Hello, I'm trying to make a JPanel with JFrame capabilities, such as resizing, and moving, Everything seems to work fine, altough there are minor flickering inside the JPanel, I have numeral repaints and I have a method called update(), which uses absolute position to arrange Containers and Components. Whenever the … | |
Hi all, Im trying to remove from a HashTable by providing key and to get by proving key. And i tried as follows for removing, Caharcter ch=p.charAt(i); but gives these errors. myOwnBm.java:60: cannot find symbol symbol : method Remove(char) location: class java.util.Hashtable myHash.Remove(p.charAt(i)); ^ myOwnBm.java:77: inconvertible types found : java.lang.Object … | |
Hi i need to add crosshairs to my code, like draw 2 lines across the screen on a JPanel, i also need to be able to turn them on and off with a checkbox which is on a JPanel. the other panel needs to be drawable on like a paint … | |
Hi! I'm working on a school project and ran into a problem. We're creating an ArrayList of basketball games where each game is set up as: [CODE] public Game (String homeTeam, int htScore, String opponent, int oppScore) { this.homeTeam = homeTeam; this.htScore = htScore; this.opponent = opponent; this.oppScore = oppScore; … | |
If we are given a data set which has student marks, GPA and Attendance, how can KNN be used to find the best 4 students? I admit, that this is a homework question, but I am not asking for the code ... I will do that myself.... I only need … | |
hello everyone i have wrote a code but it shows [B]"org.apache.tomcat.dbcp.dbcp.SQLNestedException:"[/B] error org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null' at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1150) at org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880) at listener.MyContextListener.contextInitialized(Unknown Source) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041) at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277) at … | |
hello frnd i am wriing program on in which i try to connect mysql with servlet but it gives error here is my code [CODE] [B]Test.java[/B] package my; import java.io.IOException; import java.sql.Connection; import java.sql.SQLException; import javax.naming.Context; import javax.naming.InitialContext; import javax.naming.NamingException; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.sql.DataSource; … | |
my problem in here is that i want to input chairs for the barber shop, there should be input chairs button and i will input how many chairs i want, and if for example i will input 4 and press ok, the barber chairs will become 4 also , and … | |
Hello there I am using RAD and there is some problem with my websphere its not publishing anything here is the error ........................................................................................... [ATTACH]24189[/ATTACH] ........................................................................................... Tagged the screenshot of y problem please reply...... | |
I have a school project and what is needed is to Write a program that prompts the instructor to enter the 10 grades of midterm 1 and store these numbers in an array. Next prompt for the 10 grades of midterm 2 and store these numbers in a different array. … | |
hey, so I am just starting java3D, and I am running into some pretty basic problems... I started a tutorial online (from [url]www.java3d.org[/url]) and the first sample program is: [CODE]import com.sun.j3d.utils.universe.SimpleUniverse; import com.sun.j3d.utils.geometry.ColorCube; import javax.media.j3d.BranchGroup; public class Hello3d { public Hello3d() { SimpleUniverse universe = new SimpleUniverse(); BranchGroup group = … | |
hi below code is an example.I hav couple of questions 1)The highlighted bold red code(myParrot[0]...)can it be simplifyed? 2)Can i use random to generate a given set of numbers?How? [CODE]public class Bird{ public static void main(String[] args) { int[] myParrot = new int[3]; [B][COLOR="Red"]myParrot[0]=1; myParrot[1]=2; myParrot[2]=3;[/COLOR][/B] for (int feature=0; i<myParrot.length; … | |
I was told to use a while loop and call the nextNumber method until the input matches the corresponding fibonacci number, i.e. an input of 4 would give fib(4)=3. I'm getting fib(4)=1. Here is my code: [CODE] /** Class used to generate a Fibonacci number with a given input */ … | |
a class can have only one constructor??? thanx regads | |
Hi everybody. I'm trying to display web page that located in my computer or just (google web page). But everytime I'mgetting nullpointer exception. Please help me to figure out the problem. here is the absolute path that I'm using: [CODE]serg@serg-PORTEGE-Z835:~$ find $PWD -type f -name test1.html /home/serg/Projects/java/GUI/src/its/TestData/test1.html [/CODE] But the … | |
Hello, I've got this problem with an intro to Java class. To lay some background down, the professor teaches the 'theory' behind java, and nothing of actual code, so my knowledge is very limited here. The reason I'm here is I can't discern for the life of me how to … | |
So basically I have to import a file of names and then be able to sort them alphabetically I've managed to import the file using the followig code [CODE] import java.io.*; public class Name{ public static void main(String[] args)throws IOException{ String contents; File f = new File("names.txt"); FileReader fr = … | |
I'm getting this error variable might not have been initialized on ch2 and ch3: [CODE]import javax.swing.JOptionPane; public class calculatorJava { public static void main(String[] args) { String ch, ch2, ch3, add1, add2, sub1, sub2, mul1, mul2, div1, div2, choice1, exp; int chans, chans2, chans3, addo1, addo2, subO1, subO2, mulo1, mulo2, … | |
I'm making a website and of course want to incorporate memberships and logins, etc and while I understand the theoretical application of salting and hashing a user-inputted password to save the encrypted pass in my database, I'm not sure on the approach... What I would do is get the hashCode … | |
As i said in the title",. i dont know what was the missing",. (i will just attach the jar file) please help"., by the way", it is a game named sokoban. | |
hi there, i have this server code that send the received message from one client to all the other clients, including the one how send the message [CODE]public class Chat extends Thread{ static LinkedList<PrintStream> sll; Socket cs; PrintStream ps; public Chat(Socket cs){ this.cs=cs; try{ ps=new PrintStream(cs.getOutputStream()); sll.add(ps); this.start(); } catch … | |
Hello! I was given the task to finish writing the definitions of the Treeset class methods. I'm currently at the [B]headSet[/B] and [B]tailSet[/B] functions and quite stumped. Here's what they look like currently, with no logic: [CODE]@Override public SortedSet<E> headSet(E before){ SortedSet<E> set = new SearchTreeSet<E>(); headSet(root, before, set); return … | |
Hi, I have a problem with some resource files (i.e. .txt) which I have created in the project under let's say com/myapp/resources. I have a class created: com.myapp.util.MyClass which reference a file.txt located in resources folder: [CODE] MyClass.class.getResourceAsStream("../resources/file.txt"); [/CODE] The project is created in eclipse. After I export the project … | |
Any tips on how to connect them? COmments are highly appreciated. Thanks! | |
Hey everyone, I'm trying to make a button have an image, it used to work but for some reason, now it doesn't. This is the error: [COLOR="Red"]Exception in thread "main" java.lang.NullPointerException at javax.swing.ImageIcon.<init>(Unknown Source) at Main.createImageIcon(Main.java:109) at Main.<init>(Main.java:82) at Main.main(Main.java:103) [/COLOR] I see that the error is the: [CODE]ImageIcon NewFileIcon … | |
I am wondering if there is a way to make a MySQL database using my java program without actually having a defined username for the admin. for example I would make a program that you could install on all computers in a network that connect to a newly made database … | |
Hello everyone .. I am new to this excel reading !! Introduction: I have a link to a txt-file(or doc file) in excel file and i need to read a data present in the linked file. I can read normal text present in excel file.. Problem : but not able … |
The End.