35,618 Topics
![]() | |
Hi Friends, I want to convert given String of any language to Unicode.Please solve my porblem friends. Thank you cheers -------- siva | |
Can somebody please show me what the rest of this code should look like. I have about 90% of it so far. I have the GUI, but need help with the rest. Here is the Link to my code and the question to the problem is below. I thought it … | |
[CODE]public class duplicate { public static void main(String[] args)throws IOException { System.out.println("Enter words separated by spaces ('.' to quit):"); Set<String> s = new HashSet<String>(); Scanner input = new Scanner(System.in); while (true) { String token = input.next(); if (".".equals(token)) break; if (!s.add(token)) System.out.println("Duplicate detected: " + token); } System.out.println(s.size() + " … | |
[CODE]private void getPreviousButtonActionPerformed(java.awt.event.ActionEvent evt) { List<Tweet> listOfTweets = remoteBean.getMoreTweets(5); StringBuilder displayStringBuilder = new StringBuilder(); if(listOfTweets != null) { for (Tweet tweet : listOfTweet) { displayStringBuilder.append(tweet.toString() + "\n"); } textArea.setText(displayStringBuilder.toString()); } } [/CODE] As it stands when i run the code that this method is in and enter a number of … | |
I'm newbie in java, can you help me to this code. the image needs to move diagonally [CODE]public void actionPerformed(ActionEvent e) { x += 3; if (x > 600) { y = random.nextInt(600); x = random.nextInt(-45); star.setX(x); star.setY(y); }[/CODE] | |
How can I pass multiple values from a JSP to a servlet using an hyperlink. Following is my code [CODE]<div style="width:500px;height:20px;border:2px solid blue; padding-top:25px; padding-left:40px; padding-right:20px; padding-bottom:10px;"> <jsp:include page = "/Alphabet.jsp"/> </div> <a href = "cart.jsp"><img src="shopping_cart.jpeg" width=50 Height=75 alt="Shopping Cart" border="0" style="float:right;"></a> <%@ page import="com.classes.chemical.*, java.util.ArrayList" %> <td width … | |
i found error in the following code.... [CODE]import java.sql.*; import java.util.*; class search { public static void main(String args[]) throws Exception { Connection con=null; ResultSet rs=null; Statement st=null; Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:oracle","user","vinay"); String s="select *from student where roll=?"; st=con.prepareStatement(s); rs=st.executeQuery(); Scanner inp=new Scanner(System.in); System.out.println("Enter roll to search"); int r=inp.nextInt(); st.setInt(1,r); while (rs.next()) … | |
I want to create a patient appointment schedule desktop app with an oracle database. Basically its going to be 2 computers with the app and one of them is going to have the database service running. Ok so my question is... should i do it in eclipse or netbeans? am … | |
Hi all, I'm working on a C++ app that needs to communicate with a server. I was wondering if it would be possible to use Java for the Server, and C++ for the Client. I'm assuming it should work (without the use of JNI) because TCP packets are TCP packets, … | |
hi, I want to run the command using java code echo $PATH I used Runtime.getRuntime().exec() for this, but it returns outputp as : $PATH. I know I can get the value of PATH variable using System.getProperty() but I want to use particularly "echo" command. How can I do it? | |
I'm trying to merge cells of the same row and after researching i found this link: [url]http://codeguru.earthweb.com/java/articles/139.shtml[/url] I downloaded the files and tried using it but it didn't run because of an error I don't understand:S can anybody help?? | |
Hello Friends.. need a help with Merge Sort I tried to implement Merge Sort using Java language..I followed Introduction to Algorithm book for the algorithm.. but the code generates errors.. please can anyone explain this to me.. why these errors pop-up ?? [CODE] package test; import java.util.Random; public class mergeSort … | |
I have a set of radio buttons.These radio buttons are associated with some questions for survey.I also have a Submit button.I want that as soon as I click the Submit button, the application should read the status of radio buttons.But I am unable to figure out a way of doing … | |
Hello guys.. Im very new to java. Im using netbeans 7.0 and JDK 1.7. Im an IT student. My teacher said that we must use only Java DB (don't know why) for our database. I've already made a program. It will display all the contents of a table. My problem … | |
I have been fighting this but I am not winning. So far I have looked up a ODBC JDBC connection string to connect to my simple database to java without any success. Firstly; I replaced 32bit MS Access 2010 with 64x one. Secondly; I installed all available updates sp1 and … | |
Hi All, I have problem while using prepared statements. i have a "Select" query in a xml & i m reading it through XML parser & supplying inputs throughs prepared statements. When i execute i am not getting desired results. Below is the snippet : String res=query (query is String … | |
hi all i want to add picture to my frame how i can do that i use this code ImageIcon image=new ImageIcon("f:\\a.jpg"); | |
Using the basic principle in this code: [CODE] try { GraphicsEnvironment ge = GraphicsEnvironment .getLocalGraphicsEnvironment(); GraphicsDevice[] gs = ge.getScreenDevices(); BufferedImage[] screenshots = new BufferedImage[gs.length]; ImageWriter writer = null; Iterator<ImageWriter> iter = ImageIO.getImageWritersByFormatName("jpeg"); if (iter.hasNext()) writer = iter.next(); ImageWriteParam iwp = writer.getDefaultWriteParam(); iwp.setCompressionMode(ImageWriteParam.MODE_EXPLICIT); iwp.setCompressionQuality(0.1F); DisplayMode mode; Rectangle bounds; for (int i … | |
Hi guys, i have been able to get this transfer function to work but only with one account. i'm not too sure how to get it working for the other account also. Any help would be greatly appreciated. [CODE]static String doTransfer(String amount){ // Withdraw cash -- called from ATMWithdrawl String … | |
Hi guys, I'm working on a console based application and I'm struck in a control flow issue for driver class. Any assistance is appreciated. This method from the driver class call method from inventory class to search for a item that is stored in an arraylist. On query it return … | |
ive been looking up, and their seems to be many way to read from a file. my question is, how do you read from a file. the file setup is like this.... the first line is a number(830) representing number of words, next lines are words.. the file looks like … | |
hi all , I did a application in jsp servlet and ejb with mysql db .. how should i host in wweb server pls any one help me Thanks in advance Anand | |
I have this problem, that whenever I set the frame size using the setSize () method the size inside the frame is actually smaller, because the frame size is included in this dimension. My question is how would I make it so that the inside of the frame is the … | |
is there any open source project for custom menu for java desktop app? | |
Guys I ask if any one can help me . i have to write application which take images from web cam can anyone help me , by providing where i must read , as i googled it , and the results weren't good . | |
I m developing a java app that will have a GUI to draw the graph and implements the graph coloring algorithm to colour the nodes. I started with JFrame and Canvas and could draw lines and circles with paint() and repaint methods.. The problem is repaint method erases the previous … | |
can anyone help me correct and make my payslip work......how can I correct line 303,306 and 309.................. [CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class payslip3 extends JFrame implements ActionListener { private static int width=600; private static int height=300; private JLabel[] labelJL = new JLabel[18]; private JTextField[] textJT = new … ![]() | |
[CODE]public void readArguments(String[]args ) { String [] readArray = new String[ 10 ]; Scanner readscanner=new Scanner(System.in); // read values from keyboard into array System.out.println("Enter your arguments or type Exit to exit the loop"); for ( int i = 0 ; i < readArray.length ; i ++) { if(readArray[i] =="Exit" ) … ![]() | |
So, I've created a game. I want it to connect to a database to get some information. This is the problem I'm getting the console. [code] com.mysql.jdbc.CommunicationsException: Communications link failure due to under lying exception: ** BEGIN NESTED EXCEPTION ** java.net.ConnectException MESSAGE: Connection refused: connect STACKTRACE: java.net.ConnectException: Connection refused: connect … | |
Dear All, i have been tugging my hair out for 3 days and i cant find the problem !!! im writing a code in Aglets, i have to classes, Master and SayItAglet [B][U][COLOR="Green"]Master.Java[/COLOR][/U][/B] [CODE]package simple; import com.ibm.aglet.*; import java.net.*; public class Master extends Aglet { private AgletContext thisContext = null; … |
The End.