36,051 Topics

Member Avatar for
Member Avatar for gedas

hey, i have got a class that extends JPanel called viewPanel and in there, there is paint method. in the paint method there is a oval point drawn on it. the coordinates x and y for the point are generated by using math.random so when the program executes the point …

Member Avatar for gedas
0
105
Member Avatar for greeshmapc
Member Avatar for diafol
0
64
Member Avatar for Enzo85

Hello everyone, I am trying to read a .rtf file, does this have to be done using the RTFeditorKit? Can a .rtf file be read line by line like a normal .txt file, as I was planning to read it line by line (as a string) to remove punctuation first …

0
114
Member Avatar for jackmaverick1

Hi, I'm very new to Java (started today, though I have 1.5 years in c++) and I've now read a little bit about Java, the thing that I can't find is how to take user input from the keyboard through a console window... How can you go about do that? …

Member Avatar for sourabh17
0
201
Member Avatar for DarkLightning7

I am trying to use the java XOM libraries but I am having trouble getting them to work the way I want them to. I want to get each element and its attributes from an xml file then use that information to create folders and files on the users computer …

Member Avatar for DarkLightning7
0
326
Member Avatar for Naqib

Hy welcom to all. I want to controll mini remote controll car from laptop. i have only experience of java desktop application. but no experience in wireless programming. what i do to complete this project thanks

Member Avatar for VernonDozier
0
203
Member Avatar for patel.ajay82

[code] import java.util.Properties; import javax.mail.Message; import javax.mail.MessagingException; import javax.mail.Session; import javax.mail.Transport; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; public class SendMailTLS { public static void main(String[] args) { String host = "smtp.gmail.com"; int port = 587; String username = "avdhoot.patel@gmail.com"; String password = "password"; Properties props = new Properties(); props.put("mail.smtp.auth", "true"); props.put("mail.smtp.starttls.enable", "true"); …

Member Avatar for kvprajapati
0
3K
Member Avatar for arshi9464

i made a jsp page, now i made a LAN named "ar", and connected another computer with "ar" network. Now i want that the client computer i.e. computer 2 should access my jsp page which is arsh.html , how to do this????? My approach: i set my IP as 192.16.1.44 …

Member Avatar for arshi9464
0
126
Member Avatar for bharath54321
Member Avatar for MeandJava

Hello everybody, My team and I have an idea of a product to develop. It's a kind of game we want to run in Actionscript. Unfortunately our hardware (buttons, lights, maybe sounds) works with Java can we combine those two or do we have too choose one of the languages? …

Member Avatar for peter_budo
0
148
Member Avatar for 1ML

Hi, I've started developing for Androind [ditched Symbian but that's a whole diferent styory], and I'm not what you'd call a naturall Java developer [much prefer c++]. Eclipse seems to run rediculously slowly on windows 7 (64bit), and running a dual boot system with Linux [on which it seems to …

Member Avatar for 1ML
0
586
Member Avatar for coderN

[B]I am stuck at a program, where I have to print all the subsets of a given arguments, I printed n-binary digit using recursion but i cant not use the same algorithm. ..lets say % java SubSet acd {,a,c,d } which will print {a} {c} {d} {a,c}, {a,d}, {c,d}, {a,c,d} …

Member Avatar for JamesCherrill
0
42
Member Avatar for iShrne

Hii every One i create Doubly Linked List with all methods i need , but is still one question which i really did not understand it very well it said : write a method to create linked list from double linked list using the methods available in myLinkedList(which have the …

Member Avatar for JamesCherrill
0
153
Member Avatar for bhallarahul

Can anyone tell me which website/book is best to learn RMI and JAVABEANS COMPONENT

0
45
Member Avatar for vidyashanmugam

I have retived dats from database..by using JSP to design tables..i wanted to downloaded it..how plz help me..Plz reply..

0
47
Member Avatar for huBelial

I'm trying to connect to db2 but I keep getting errors. I have db2 installed on a windows 7 user account called "db2admin" The database I'm trying to connect to is called "db2database" The username and password for that account is: db2/db2 This is my code: [CODE]try { Class.forName("com.ibm.db2.jcc.DB2Driver"); Connection …

Member Avatar for huBelial
0
82
Member Avatar for Frengerdany

Hi I have a problem with RSA encryption/decription of txt files, I have one method to create a pair of RSA keys and save them into a file, then i made two methods, one for encryt and one for decrypt, encrypt method works fine, but when I want to decrypt …

0
147
Member Avatar for RagingRiver

I am having a problem with left alignment after adding a second JPanel. Both JPanels are using the BoxLayout with the first set to Y_AXIS and the second set to X_AXIS. If you comment out the add(twoPanel) it results in the desired left alignment. I don't understand why the alignment …

Member Avatar for Ezzaral
0
414
Member Avatar for tmcculloch
Member Avatar for steelshark
0
152
Member Avatar for stupid guy

hi all, m new to this site and m newbee to this java thing..i have a project dnloaded from somewhere ..and now i have some problem with updating the database ..following is the [CODE] cnt=cnt+Integer.parseInt(dis.getText()); System.out.println(cnt); cnt=cnt+ Integer.parseInt(ent.getText()); System.out.println (cnt); String str="update bikeinfo set stock =" + cnt + " …

Member Avatar for Ezzaral
0
131
Member Avatar for MrHardRock

Hey everyone I need to write a tic tac toe program vs the computer using an array. I have gotten almost all of it done but I am totally stuck on this error. Any help would be much appreciated, thanks in advance. My error being on line 221 and 222 …

Member Avatar for audiomatic
0
235
Member Avatar for xanawa

Hi, I am trying to use regex to validate an input from JOptionpane i want to allow the user entering ONLY digits, letters and exclametion marks. This is my line of code where i would like to put teh regex. [B]Code[/B] String message = JOptionPane.showInputDialog(null, "Enter a Message: "); Steganography.hide(message, …

Member Avatar for xanawa
0
77
Member Avatar for xanawa

hi, I would like to save a .bmp image using showSaveDialog and i cannot figure out what to use.. Below i have the code of open. [B]Code[/B] [CODE]protected void Open(JFileChooser chooser, JLabel lblPicture) { // TODO Auto-generated method stub if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) { File fileChoosed = chooser.getSelectedFile(); try { …

Member Avatar for xanawa
0
114
Member Avatar for kvskchaitanya

i'm writing a small desktop application to store details entered in to a swing ui.this application saves, edits and deletes the records.every thing is working fine but when writing searching functionality when i search the records i'm able to fill the searched record in to the text fields successfully.but if …

Member Avatar for kvskchaitanya
0
169
Member Avatar for titosd

Hello, I wrote a program by RMI, when I compile it by the cmd, the client class dosn"t compiled, it"s arrive to the lookup and stop. this is part of my code: Client Class: (the lookup doesn"t succeeded, when i compile it, print demo 1 , demo 2 and demo …

Member Avatar for thekashyap
0
133
Member Avatar for 8.brahim

I want to draw an image at X Y position when the user click the mouse so I'm using an InternalFrame with layout set to NULL , inside a JFrame with Layout free - using netbeans here is the image class [CODE=java] package myPak_1; import java.awt.*; import java.awt.image.*; import java.io.*; …

Member Avatar for 8.brahim
0
234
Member Avatar for Joslup
Member Avatar for mKorbel
-1
93
Member Avatar for rayden150

So i found a code thats the Java equivalent of the bubble sort algorithm, i understand parts of it, but the thing is i dont get how it works, specifically the loops which i assume do much of the work, can somebody please explain to me, i swear if i …

Member Avatar for thekashyap
0
175
Member Avatar for seleniumJava

I need a bit a help to randomly select a radio button on an page to answer questions. I am doing some Selenium / Java / webdriver development and sort of new to this. Below is a some code to find the number of radio buttons. any help that someone …

Member Avatar for lxXTaCoXxl
0
335
Member Avatar for gauravk_bhanot

I am working on a application for which i need to connect it to a database. I have chosen postgreSQL. But i cannot connect it to java. Can somebody help. I tried this [url]http://www.faqs.org/docs/ppbook/x20856.htm[/url] but i don't know how to set classpath.I am currently working with windows xp.

Member Avatar for gauravk_bhanot
0
176
Member Avatar for andyhunter

if items are added into an arraylist would another arraylist be required for grouping items or would a hashmap or something else be required i.e. title, firstname, last name etc saved indvidually but therefore grouped to equal person 1 and so on ? the reason for grouping is to edit …

Member Avatar for thekashyap
0
153
Member Avatar for juan92

currently i am taking a java class, and out professor is introducing it with the language processing so we get the idea of how things work. he moentioned that processing comes from java, so that's the reason i posted it here. i made a really simple game somewhat of a …

Member Avatar for juan92
0
139
Member Avatar for serdas

I really need help from someone who knows Java I have to create some fake users on server and also create a stream for them with videos could anyone please help me with this? thank you

Member Avatar for serdas
-1
78
Member Avatar for andyhunter

trying to create a matcher for finding if title is not correct i.e. has to be mr, mrs, miss etc..but this allows mrmrmr etc when it should not. tried different setups to keep failing i.e. [[]] or (). [ICODE] public void valTitle(){ //validate title while (this.title.matches("^[\\s]+$") ||this.title.matches("") ||this.title.matches("[^m]&&[^r]*") ){ System.out.println("Title …

Member Avatar for andyhunter
0
87
Member Avatar for java_programmer

I am trying to write a simple servlet program. But getting the error The requested resource (/servletexam/LoginServlet) is not available. I have created two servlet classes as follows - [B]LoginServlet[/B] [CODE] public class LoginServlet extends HttpServlet { Hashtable<String,String> users = new Hashtable<String,String>(); public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, …

Member Avatar for java_programmer
0
309
Member Avatar for kris0r

Hi all, In a nutshell what I'm trying to do is make a group of objects, but I don't know what their name will be until I want them made. Is there a way of getting round this? I can't simply use [CODE]Object variablename = new Object()[/CODE] because it won't …

Member Avatar for jon.kiparsky
0
81
Member Avatar for terexberd

Could you tell me why programmers use this.variable ex. (this.miles) in constructor, and what is the advantage of using it?

Member Avatar for jon.kiparsky
0
141
Member Avatar for musikluver4

I have a JFrame with 2 JPanels...my problem When I attach one of the JPanels to the JScrollPane object, it encompasses the whole JFrame, instead of just the JPanel I said to attach to. The scrollBar goes all the way up to the top of the JPanel I don't want …

Member Avatar for musikluver4
0
752
Member Avatar for xanawa

Hi, I am doing a project on picture editing and i have a null pointer exception in blur and i can't find out what's wrongs.. AIn this project i only can load .bmp images below is the code. Help me pls. Code: [B]Effect Class[/B] [CODE]import java.awt.image.BufferedImage; public abstract class Effect …

Member Avatar for Ezzaral
0
544
Member Avatar for bhallarahul

[CODE] import java.sql.Statement; import java.sql.Connection; import java.sql.SQLException; import java.sql.DriverManager; import java.sql.ResultSet; class db { public static void main(String arg[]) { Statement statementObj=null; Connection connectionObj=null; try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); connectionObj=DriverManager.getConnection("jdbc:odbc:sensorData","",""); statementObj=connectionObj.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); System.out.println("do not worry ho ga yr ho ga"); statementObj.executeUpdate("INSERT INTO hardwareData (Time, Date, humidity, Temp, DiesalLevel) VALUES('1','12','3','s','a')"); connectionObj.close(); } catch(ClassNotFoundException …

Member Avatar for Ezzaral
0
312
Member Avatar for Alpdog14

I have a Coin class that compares weight and value and I need help developing a hashcode and Junit tests to test them, here is my class: [CODE]public class Coin implements Comparable<Coin>{ public static final int CENT=1, NICKEL=5, DIME=10, QUARTER=25; private int value; private double weight; public double getWeight(){ return …

Member Avatar for JamesCherrill
0
183
Member Avatar for anders10

Hello! I have a minheap class that is implemented as a priorityqueue and it works fine as far as to the iterator that I have to implement as a innerclass. But I can't get it to work properly. Here is part of the code: public class MinHeap<E> extends AbstractQueue<E> implements …

Member Avatar for anders10
0
142
Member Avatar for fyezool

cant compile the code...please help me![code]import java.io.*; class football { public static void main(String args[])throws IOException { BufferedReader stdin = newBufferedReader(newInputStreamReader(System.in)) String str; int num_team,num_win,num_draw,total_point,point; for(num_team=1;num_team;num_team++) System.out.print("Enter team compete"); str=stdin.readLine(); num_team=Integer.parseInt(str); System.out.print("Team 1"); System.out.print("Enter total win"); str=stdin.readLine(); num_win=Integer.parseInt(str); System.out.print("Enter total draw"); str=stdin.readLine(); num_draw=Integer.parseInt(str); total_point=(num_win*3)+(num_draw); System.out.print("Total point for team 1 is" …

Member Avatar for Sadun89
0
133
Member Avatar for Tazsweet19

How do I take to set up for network connect with Socket. I make the JList to press Go to run the post processing (like files). I feel about it and it is not work for me I try to figure out. Thanks. [code] public final static int port = …

Member Avatar for Tazsweet19
0
117
Member Avatar for pythonbegin

Hi all I have a program that is written in java and have three different executables program.sh, program.bat, program.jar. i can starts the gui by using program.jar and then in gui i can enter parameters. but as i want to run it over several parameters and get the outputs. i …

Member Avatar for JamesCherrill
0
215
Member Avatar for Dean_Grobler

Hi there, I understand that this question might be better off in "hardwareAndSoftware/LinuxAndUnix/LinuxApplicationsAndSoftware". But the truth is, that it takes for ever for someone to respond to posts there, because I don't think anybody visits that forum alot. Anyways, back to the point... I'm trying to install the Java 1.6 …

Member Avatar for mKorbel
0
261
Member Avatar for echocoder

I am using the following string and Java code to create a user on a Linux box via Java. [CODE=java] ... String x = "/usr/sbin/useradd -g users -s /bin/bash -c 'FIRST M LAST, STERK,DIV-DIS-OFF,123-456-2913' -p 2342asdfa231rcawef09 -d /home/flast -m flast"; RunCommand(x); ... [/CODE] However, upon execution it spins a list …

Member Avatar for thekashyap
0
300
Member Avatar for AaronLLF

I'm creating an NBT viewer in Java. It works fine as a console application so I used code to rewrite all console (system.out.println) text to GUI text. It works but it does not use scrollbars correctly. Here is my code (For my window/GUI void) [code] private static void createAndShowGUI() { …

Member Avatar for mKorbel
0
305
Member Avatar for HelloMe

Hi everyone... I made a simple java game in Eclipse Helios ver. 3.6.1. Now i want to send that game to my sister as an Executable. Can someone please explain to me how i do it? Thank you very much...

Member Avatar for HelloMe
0
130
Member Avatar for raheelanc

The End.