- Strength to Increase Rep
- +6
- Strength to Decrease Rep
- -1
- Upvotes Received
- 9
- Posts with Upvotes
- 9
- Upvoting Members
- 7
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 1
I am always ready to help
- Interests
- Formula 1
- PC Specs
- Ubuntu an Windows XP Professional, 2.4GHz Core 2 Duo, 4GB RAM
84 Posted Topics
Re: Maybe you can try this to read your file [CODE] File fil = new File(FileName); FileInputStream fis = null; BufferedInputStream bis = null; DataInputStream dis = null; try { fis = new FileInputStream(fil); // Here BufferedInputStream is added for fast reading. bis = new BufferedInputStream(fis); dis = new DataInputStream(bis); //Then … | |
Re: [QUOTE=hsaraiya;1088848]I am trying to Draw a graph which can read data values from Text files. In which i want to consider 1st column as X-axis and 2nd as Y-axis.[/QUOTE] You can use a charting API. There are many like JFreeChart (my personal favourite), JMathTool, JChart, etc. You can also develop … | |
Re: [QUOTE=ardi_lucy;1079477]help me plz i need to sort ip address, am try to sort in java.util.Arrays.sort() but it not correct for eg [CODE] String st[]={"10.4.23.16","10.4.23.9"}; java.util.Arrays.sort(st); for(int i=0;i<st.length;i++){ System.out.println(st[i]); } [/CODE] the out put is 10.4.23.16 10.4.23.9 plz give idea[/QUOTE] The Algo which you a using will sort the string array. … | |
| |
Can anyone suggest a open source llibrary for plotting 3D graphs . More precisely dynamic graphs. I was using jfreechart but that is only for 2D plots. I need a library so that I can plot 3D graphs............. | |
I am attaching my complete code, which I was currently developing. I am not able to get why doesn't my KeyListener work. None of the KeyListener events are fires on pressing the keyboard. Please have a look and tell me the flaws in my code [ATTACH]22414[/ATTACH] | |
In my application, I have to draw 25 images of 700*500 pixels. I am trying to use ImageIO.read() method, which is called by creating another Thread. Its taking too much time to read images. I thought since i am calling the image read functions by creating another thread my another … | |
I want to have two textfields which will have the following validations 1) Both should be Integers 2) The value in one textfield should be a integer multiple of other I have used two JFormattedTextFields to this. This is what i have done till now [CODE] NumberFormat updateFormat,sampleFormat; updateFormat = … | |
I have written a code which uses RXTX Serial API for communication. Now I want to distribute a jar file for my program. The problem is that since I have used RXTX Serial API jar & dll files for this needs to be copied in java home. I wrote a … | |
I am using JPQL to write queries. I have an SQL as [CODE] SELECT * FROM `powergenerationdatapoint` AS pgdp INNER JOIN ( SELECT MAX( TIMESTAMP ) TIME FROM powergenerationdatapoint GROUP BY solarpanel_id )maxtime ON pgdp.timestamp = maxtime.time WHERE solarpanel_id IN ( SELECT id FROM solarpanel WHERE solar_plant_id =1 ) GROUP … | |
Re: [QUOTE=nidhish31588;1496611]still not working.............. [CODE] import java.applet.Applet; import java.awt.*; import java.awt.event.*; //<applet code=newt.class width=1200 height =1200></applet> public class newt extends Applet //implements ActionListener { BufferedImage img = null; public void init() { try { img = ImageIO.read(new File("D:\Winter.jpg")); } catch (IOException e) {} } public void paint(Graphics g) { g.drawImage(img, 10, … | |
I need yo draw a shape as attached in the image using Java graphics. I am struggling with the curve part. The curve part is a arc of an circle whose radius and center is known. But I have to paint the region out side of that arc. How will … | |
I have to draw a Circular gauge using Java Graphics. Somewhat similar to the attached image, the circular gauge without the black border as in image. I tried to use two methodologies but none of them is working perfectly Firstly, I tried to draw everything using Java Graphics and then … | |
Re: The flaw in your algorithm is that you are not multi[lying your change by 100. You need to multiply the change by 100 if you calculating the coins using Cent Value of the coin | |
I have a php page, which has different forms. One of my forms contains a table of data. I want only this form (not the complete page) to be updated in a fixed period of time. How could I do this? ![]() | |
Hi, I am a novice programmer at PHP. I want to redirect my webpage to another webpage. The problem is that First I want to output a file as an attachment and then redirect the web page I have used this code to output the attachment file [CODE] header("Content-Disposition: attachment; … | |
Re: [QUOTE=suger;1400075]Hi Guy The problem is still not solved, anyone has more ideas? Thanks heaps[/QUOTE] For your first problem where you cannot see the polygon is because you have not entered valid coordinates for polygon. Enter the coordinates of polygon in clockwise or anticlockwise manner. Secondly to close your frame add … | |
I have saved generated an image using a byte[] by using [CODE]Toolkit.getDefaultToolkit().createImage(image);[/CODE] where image is a byte[]. The image generated by this is of java.awt.Image instance. Now I want to save this image into my local hard disk as JPEG (the image was decoded as JPEG). How would I do … | |
I have a database hosted at a remote location. I want to access that database. But I keep getting the error [CODE] com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Access denied for user 'username'@'%' to database 'db' [/CODE] This is the code that i have written [CODE] Connection con = null; Class.forName("com.mysql.jdbc.Driver"); String username = "username"; … | |
When we use File.getAbsolutePath() we get the path of file as C:\BlahBlah\Blah.txt. But I want the path name as C:/BlahBlah/Blah.txt i.e instead of backward slash "\" i want a forward slash "/" in the path. How to get this. I tried to create a parsefile method. [CODE] public String parsePath(String … | |
I am writing some data to a file using FileWriter and BufferedWriter. I want that while writing in the file if somebody else wants to open the file in MS Excel, it should open only in read only mode Here is a snippet of my FileWriter and BufferedWriter [CODE] while(true) … | |
Is it possible to access a TCP server running outside our LAN through internet? I thought we could use the router IP Addess(which I got from whatismyip.com) in the class Socket Constructor[CODE] Socket(InetAddress address, int port) [/CODE]. But client wasn't able to find the server. Has anybody successfully achieved this … | |
I want to Run a ftp server on my machine. My FTP Client will send the data to FTP Server (not a file but byte data). The FTP Server should listen to the data, store it in a file on the local hard disk. How can I wrote a code … | |
I have old Toshiba Satellite A-80 Laptop with XP Home. I want to format my system and install Windows XP again. The problem is that my CD/DVD ROM is not functioning. I dont have an option to boot from USB in my BIOS. I dont want to purchase USB CD … | |
I have a class which extends JPanel and implements ActionListener. I am having 2 menuItem. When I implemented the abstract method actionPerformed(ActionEvent e) and used repaint if the event source are the menuItem paint method is not called. What can be the possible reasons? This is what I am doing … | |
I have a 2D image of a map. What I want to do is 1) Paint this image in a 3D Canvas. And then rotate it with the help of mouse 2) Secondly do some path planning, i.e If I select 2-3 points in space on top of that map … | |
Re: [QUOTE=jemz;1183787]hello can you help me i want to make my program to executable file is there a software for this to create a jar file?...hoping for your positive responds...[/QUOTE] IDE like netbeans create your Jar file when you build your peoject. [URL="http://netbeans.org/kb/articles/javase-deploy.html"]This will help you[/URL] | |
I want to Edit the Title of Save Dialog Box in JFileChooser from Save to Something Else. How is it possible? | |
Hi, I need a charting API which can plot static Line Graph for 300 million points. API should support zooming and panning of axes comfortably after plotting 300 million points. I tried with JFreechart but the result is not good for even 100 million points. Does anybody have any Idea … | |
Re: First of all always use Code tags. If you only want to hide your frame and dont want to close your application you can use frame.setVisible(false) in your done button ActionListener so that you application wont exit only the frame will be hidden | |
Re: [QUOTE=MaxWildly;1163675]I am not getting the correct output for this method. I have looked at the BigInteger class, and even tried to implement, after rewriting for my instance variable, but it did not carry the numbers over to the next digit, or bring down the remainders. Thanks in advance. [CODE] public … | |
Re: I am not sure what you intend to do. Why do u need to create an array of Integers from one String. As far as I think one String will correspond to one Integer. Why do you need an array. For converting one string to an Integer value you can … | |
Re: [QUOTE=gaya88;1146787]hi I have a problem regarding calling print() method through main().It asks to pass arguments but i already done so using constructors.Any help in missing statement. [code] public class ElectricityBill { public static void main(String args[]){ current c1=new current(500,"January"); current c2=new current(1600,"February"); c1.print(double total,String month);/[COLOR="Green"]/this is the place i wanna … | |
Re: Where is the sale and purchase of Inventory happening ? | |
I am using Ubuntu 9.04. I want to shutdown my PC using Java, when some Event is called. Please suggest what could be done. | |
Re: I am not sure but probably the class you are using isnt defined in your classpath. You might have installed some file which would had only be installed for Eclipse. You might need include the jar file in jre\lib\ext to so that the class is recognized by your command promt | |
I have RGB information about the pixels in a line. I need to draw the images in JPEG or PNG or BMP format using these information from the pixels.I dont know how to do this in java. Somebody help me out on how to start solving it out | |
Re: You are comparing the two string name using == operator. You should use String.equals(); to compare two string. == operator will compare the two string object and will result true only when both the string objects are same. | |
Re: In your firstFrame() and SecondFrame() you havent added any buttons.You added buttons only in frame.When you dispose your frame, your it buttons are lost and there are no buttons any firstFrame and SecondFrame() so they wont showup. You need to add all the buttons to your new frame firstframe() and … | |
Re: You are extending/subclassing your class to JApplet class which doesnt have the method used by you. You need to extend JFrame to use [CODE] frame.setLocationRelativeTo(null); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); [/CODE] | |
Re: [QUOTE=Shmoil;1100491]Hello, I have a school assignment to build a 2 minute countdown timer in java. Gunjannigam managed to assist me in creating the functions. My code for secondCount, I have built a function so that I can adjust secondCount to a number and it will change the timer. When secondCount … | |
Re: in Your ActionListener class simply set this frame.setVisble(false) and your other page frame.setVisble(true). Another option will be to add many panels and make setVible for this panel(false) and setVisible(true) for other panel | |
Re: If you want to navigate thru different pages, add all the componentss of 1 page in 1 panel each. Now add all the panels to your JFrame . You can either use [URL="http://java.sun.com/docs/books/tutorial/uiswing/layout/card.html"]CardLayout[/URL] to swap between the panels or panel.setVisible() method to make the required panel visible. You can implements … | |
Re: This will Reset Your button to two minutes everytime you pressed it and it will count backwards. [CODE] import java.awt.event.*; import java.awt.*; import javax.swing.*; public class Stopwatch extends JFrame implements ActionListener, Runnable { private long startTime; private final static java.text.SimpleDateFormat timerFormat = new java.text.SimpleDateFormat("MM : ss : SSS"); private final … | |
Re: [QUOTE=Flufferman;1094154]Hi, I'm having troubles with my JMenuItems and Jframe. I want that when you click on a JMenuItem the previous JPanel dissapears and the one you clicked for at the JMenuItem will appear. Now, I don't really know how to accomplish this. Someone said to me I should use the … | |
Re: [QUOTE=nyny11211;1093629]I'm hoping someone out there can help me. i have to use a 2nd class to create a JMenuBar to attach to a JFrame i get an error :49: incompatible types found : javax.swing.JFrame required: java.lang.String return aTestFrame; (i have also tried something else and got a static/non static error) … | |
Re: [QUOTE=JAbeer;1086665][CODE]import javax.swing.*; import java.awt.*; import java.awt.event.*; public class cal extends JFrame implements ActionListener { JMenuBar mb; JMenu file, help; JMenuItem esc, about; JButton btn[]; JLabel lab1 = new JLabel("0"); JPanel pan1; int i; final int MAX_INPUT_LENGTH = 20; final int INPUT_MODE = 0; final int RESULT_MODE = 1; final int … | |
Re: [QUOTE=didi00;1081157]Hi everyone. So I get the code going now the question is: How to make a menu in Java code? For example: 1.create table 2.insert into table 3.select fro table 4.delete table... Which will you choose: ex.1 and creates table I mean like switch case in C++ [code] import java.sql.*; … | |
I have a code in Java 3D through which I can draw a static(all verticies are known before hand) 3D curve. But I want to draw a dynamic(vertices specified at they at run time) curve, and the number of vertices keeps on adding up. This is the code for static … | |
Re: [QUOTE=JasonDoyle;1081627]Is it possible to output a variable and/or a string to a text file?[/QUOTE] Yes you can easily do it. [URL="http://java.sun.com/docs/books/tutorial/essential/io/"]http://java.sun.com/docs/books/tutorial/essential/io/[/URL] [URL="http://www.roseindia.net/java/beginners/java-write-to-file.shtml"]http://www.roseindia.net/java/beginners/java-write-to-file.shtml[/URL] |
The End.