32,199 Topics

Member Avatar for
Member Avatar for Demicks
Member Avatar for Web_Sailor

I was trying to read a file and print it to the JTextArea in other class. My program complies but its not printing the file content in JTextArea. Here is my MouselIstener Code [CODE]class MySaveMouseListener extends MouseAdapter { MyClass1 myobj = new MyClass1(); public javax.swing.JTextField myjtext = myobj.getTextField(); public String …

Member Avatar for JamesCherrill
0
146
Member Avatar for Ismael_Jay

[code] package awt; import java.awt.*; public class GraphicPanel extends Panel { GraphicPanel() { setBackground(Color.black); } public void paint(Graphics g) { g.setColor(new Color(0,255,0)); g.setFont(new Font("Helvetical", Font.PLAIN,14)); g.drawString("Pusyy Cat Program!", 300, 100); g.drawOval(150,200,50,50); g.drawOval(200,200,30,30); g.setColor(new Color(1.0f,0,0)); g.fillRect(30,100,150,10); } public static void main(String[] args) { Frame f = new Frame("Pussy Cat Window"); GraphicPanel …

Member Avatar for Ismael_Jay
0
88
Member Avatar for nishant52

I'm retrieving a list of names from MySql database in Java using JDBC with the help of CachedRowSet. After retrieving the list I'm appending a counter value to every name. Finally I'm updating the modified names in the database. I'm using: MySql: 5.1 Connector/J 5.1.7 JRE 1.6 Win Xp SP3 …

Member Avatar for nishant52
0
407
Member Avatar for nittynotty

Hi!!! am a cse student How to create packages in java? i used da "package" keyword and created a class in dat file . It gets compiled , but while execution i get dis error: "Exception in thread "main" java.lang.NoClassDefFoundError:" if i try to execute it by givin "java packagename.classname" …

Member Avatar for nittynotty
0
93
Member Avatar for purijatin

can you pl help me out on this problem ..i have spent a lot of time on this question but iam unable to find the answer What if i want to write a class in such a way that only one instance of it can be created , and anyone …

Member Avatar for JamesCherrill
0
2K
Member Avatar for punnakl

Here there is a requirement in my project, like sending a automatic mail to a particular person,at particular time. for examples: If there is an expiry date for a customer's account, a week before the expiry date a mail should be send to the customer as a remainder. But, at …

Member Avatar for GökhanBarış
0
103
Member Avatar for narayanabhilash

Code for Upload.... strLegalDocId = strMerchantId + strLegalStruct; String strSql = "{call Insert_FileData(?, ?, ?, ?, ?, ?,?)}"; objCst = objCon.prepareCall(strSql); objCst.setString(1, strMId); objCst.setString(2, strLS); objCst.setString(3, strFieldId); objCst.setString(4, strFileName); objCst.setString(5, strLDId); bFileSize = inpStream.available(); objCst.setBinaryStream(6, inpStream, bFileSize); objCst.registerOutParameter(7, Types.CHAR); objCst.executeUpdate(); strStatus = objCst.getString(7); System.out.println("strStatus : " + strStatus); Code for …

0
89
Member Avatar for bryan69

hi, i would like to design an intrusion detection system-type of software. is it best to use Java for it?

Member Avatar for bryan69
0
145
Member Avatar for Web_Sailor

Hi, I need to create a program in java that will create versions for the different text files I upload to my specific folders. Like suppose:- 1) I have downloaded 1st batch of files. Version control software will create some version ID for them based on date. 2) When I …

Member Avatar for JamesCherrill
0
86
Member Avatar for masterjiraya

Plssss someone help me in JAVA? I have the code here name the file as ifmdas.java: (the code is) [CODE=java] import java.io.*; public class ifmdas{ public static void main(String[] args) throws IOException{ BufferedReader stdin=new BufferedReader(new InputStreamReader(System.in)); String option, firstnum, secondnum; int num1, num2, prod, quo, sum, diff, choice; System.out.print("Choose An …

Member Avatar for dharmajava
0
304
Member Avatar for kg4cxl

New to Java and need some help...I am getting several Errors and I am not sure why here is the code and the error messages: [Code] import java.io.*; import java.util.Scanner; import javax.swing.JOptionPane; import java.util.*; import java.text.*; import java.lang.*; import java.math.*; import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.net.URL; public class …

Member Avatar for di2daer
0
177
Member Avatar for hardik.rajani

My Spring.xml is something like this: [CODE] <beans> <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"> <property name="host" value="_local-mail-server_" /> </bean> <bean id="businessLogic" class="com.logic.BusinessLogicImpl"> <property name="mailSender" ref="mailSender"></property> </bean> </beans>[/CODE] And bean definition is as below: [CODE] import org.springframework.mail.MailException; import org.springframework.mail.MailSender; import org.springframework.mail.SimpleMailMessage; public class BusinessLogicImpl implements BusinessLogic { private MailSender mailSender; public void setMailSender(MailSender mailSender) …

Member Avatar for hardik.rajani
0
3K
Member Avatar for BestJewSinceJC

After a little research I discovered some Calendar methods that were pretty nice. [CODE=Java]Date date = new Date(); int daysSinceSeen = - ( rand.nextInt() % 365 ); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); calendar.add(Calendar.DATE, daysSinceSeen);[/CODE] How could this code be returning a date in 2010? Do I have a bug that …

Member Avatar for BestJewSinceJC
0
103
Member Avatar for JohnPhilipps

Good evening, I have the need to learn how to make a picture jigsaw with java. I have been looking for hours on the web for some kind of tutorial, source code example, something anything and I haven't been successfull in finding something I could work with. Would somebody have …

Member Avatar for JohnPhilipps
0
533
Member Avatar for waqaskhan1

plz tell java script checks for not insert blank value in database when using fckeditor????? when i not insert any record,the script runs like enter ans but value also inserted in data base..i want not insert blank value and check also runs .... my code is that: [code=php] <script type="text/javascript"> …

Member Avatar for emarshah
0
192
Member Avatar for peter_budo

I'm back to start again with GBL. Application start-up layout is as desired. However as soon as I draw upon "main page view panel" with paintComponent() page view panel does overlay thumbnail panel on the left. [attach]10801[/attach] Code for main panel to group up 3 main components [code=Java]public class RottrMainPanel …

Member Avatar for peter_budo
0
156
Member Avatar for MonicaClare

Hi to all programmers.. i have a problem about this code .. i don't know what to do to this code.. i change a lot of code .. but always appear the error "illegal start of expression" .. I'm a newbie in Java.. please help me in this case.. thanks.. …

Member Avatar for llemes4011
0
175
Member Avatar for llemes4011

Hi. I have some data that I need to store in a file, and (for simplicity's sake) I was considering using bitwise operators to pack it all into a single hex or dec number. I've never user bitwise operators, as they really confuse me. If anyone has any pointers and …

Member Avatar for llemes4011
0
477
Member Avatar for vuchko

Hi, I have a problem repainting Jpanel. I wrote a simple code just to check whether it works, but notnihg is happening. Function initPanelAnswer should initialize answer panel with some image, but I wanted to make it more simply. So, according to my logic, this should print out "Paint Component", …

Member Avatar for vuchko
0
685
Member Avatar for rizillion

Hi!, I have created a user inteface named "helpGUI". This user interface contains a JTextArea. I also have created a text file named "help.txt". I need to show the "help.txt" file in the JTextArea. As I'm new to JAVA I have no idea how to do this. Given below is …

Member Avatar for peter_budo
0
748
Member Avatar for akulkarni

i wish to print sll the combinations of digits of a number eg 123 gives 321 132 231 132.... [code] class numbers { public static void main(String args[]) { int num=123; int x=num%10; int y=num/10; int z=100*x+y; System.out.println(z); } } [/code] this is all my brain is letting me to …

Member Avatar for JamesCherrill
0
110
Member Avatar for sotvisal

import java.util.*; class Array { Scanner in() { return new Scanner(System.in); } void out(String n) { System.out.print(n); } int[] getarray(int n) { int a[]=new int[n]; for(int i=0;i<a.length;i++) { out("Enter A["+i+"]: "); a[i]=in().nextInt(); } return a; } void showarray(int[] a) { for(int c:a) out("Array: " +c); out("\n"); } void sortinc(int[] a,int …

Member Avatar for zeeven
0
114
Member Avatar for akulkarni

[code] i want a program which asks the user to type the password. If he goes wrong three times exit.this is my code import java.io.*; class password1 { public static void main(String args[])throws Exception { String pass="samarth"; boolean flag=false; BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String [] password=new String[20]; int i; for(i=0;i<3;i++) …

Member Avatar for tux4life
0
263
Member Avatar for rizillion

Hi! I have added an action listener for a button. When i click this button it should go to the second tab in the tabbed pane which i have created. I have created two tabs as follows: [CODE] tab.addTab("Change Password", panel1); tab.addTab("Add new User", panel2); [/CODE] and the action listener …

Member Avatar for llemes4011
0
2K
Member Avatar for lakshay

Hi JavaExperts I have done few program in Java using Bit wise AND OR operator... But Not getting the proper output or May be I am doing something wrong Can any body explain why I am getting output class Bit { public static void main(String args[]) { System.out.println(010|4); } } …

Member Avatar for llemes4011
0
107
Member Avatar for George2

Hello everyone, I am looking for some approaches which can prevent my .class file being decompiled. My questions are, - I have heard that there is an approach called "obfuscated", I am wondering whether it is the best approach which meets my goal. If it is, where is the best …

Member Avatar for masijade
0
144
Member Avatar for manfosys

i wrote a code for download image from the website using URL class in java.The code is working fine.But the problem is after some time it shows- java.net.ConnectException:Connection timed out .Here i didnt use any proxy server and firewall.some sites gave soln as like change proxy settings or it is …

Member Avatar for manfosys
0
109
Member Avatar for sotvisal

import javax.swing.*; class Customer { int id,rate,pre,cur; String name,sex; String read(String n) { return JOptionPane.showInputDialog(n); } int readInt(String n) { return Integer.parseInt(read(n)); } void out(String n) { JOptionPane.showMessageDialog(null,n); } public Customer() { id=1; name="Visal"; sex="Male"; pre=13214; cur=13362; rate=720; } int consumption(int pre,int cur) { return(cur-pre); } int payment(int rate) { …

Member Avatar for kvprajapati
0
140
Member Avatar for vinaykumar1690

I recently downloaded the Eclipse(Ganymede) EE editor.I also downloaded the web application server community(WASCE 2.1) edition from IBM. I started off with a simple HelloWorld web application.i just displayed the msg in the default index.jsp page. When I deploy the application on the WASCE server the web browser is showing …

Member Avatar for sillyboy
0
422

The End.