84 Posted Topics

Member Avatar for aleite

After forst two lines you can try this. for(int i=0;i<3;i++) System.out.println(linha.split(" ")[i]);

Member Avatar for gunjannigam
0
110
Member Avatar for snehapatil

[QUOTE=snehapatil;1079629]hi Thanks for your reply. but i m here again to trouble you more... Please check am I doing it correctly...... because it is giving me error as [U]"Syntax error, insert ";" to complete ClassBodyDeclarations" [/U] Please help me ... Its very urgent for me Thanking you... [CODE] for(int k=1, …

Member Avatar for musthafa.aj
0
176
Member Avatar for pandalov101

This case can have 2 cases. 1) Delete all the occurence of given word 2)Delete only a given occurence(mostly first) of given word You have to split the input sentence using `String.split()` method. It will result into a array of Sring, containing all your words. Now compare all your words …

Member Avatar for gunjannigam
0
166
Member Avatar for NickT80

[QUOTE=NickT80;1080351]public class example{ This is what i have, I am just throwing things together to try and make it work... public class Movie { private int rank; private String title; public Movie(int rank, String title) { this.rank = rank; this.title = title; } } public void main (String [] args) …

Member Avatar for gunjannigam
0
121
Member Avatar for Sanit

[QUOTE=Sanit;1080151]Hey guys, I have this assignment due soon and need some help with it. I don't want the solution handed to me, but I also don't want some extremely vague answers either. I want to learn from this. Basically, what I am making is a simple applet, that has 3 …

Member Avatar for gunjannigam
0
134
Member Avatar for sulthana

[CODE]Scanner br = new Scanner(System.in); int num = br.nextInt(); Integer a = Integer.valueOf(num); System.out.println(a.toBinaryString(num)); System.out.println(a.toOctalString(num)); System.out.println(a.toHexString(num));[/CODE]

Member Avatar for javaAddict
-1
148
Member Avatar for rukshilag

[CODE] System.out.println("Enter Number of rows you want."); Scanner br = new Scanner(System.in); int num = br.nextInt(); for(int i=0;i<num;i++) { for(int j=0;j<i;j++) System.out.print(" "); for(int j=0;j<(2*(num-i)-1);j++) System.out.print("*"); System.out.println(); } [/CODE]

Member Avatar for gunjannigam
0
77
Member Avatar for P00dle

[QUOTE=P00dle;1078447]I am using the netbeans gui builder. I dragged a filechooser onto my frame, and it does almost everything I want it to do. How do I remove the buttons? I dont need them - the user just has to select a file, or type in a file name, the …

Member Avatar for P00dle
0
58
Member Avatar for beforetheyknew

[QUOTE=beforetheyknew;1076926]Hi guys, I'm returning this, it is similar to how you percieve dollars, $"32.95" etc. I calculate it in cents which is an int, but the problem is the second half cuts off the 10s of cents part if the number is less than that. eg/ 32.08. Any ideas ? …

Member Avatar for gunjannigam
0
81
Member Avatar for 9w43

[QUOTE=9w43;1076894]I have no idea what to do, it keeps on saying can not find constructor Time(int, int) here is my Patient Class [CODE] //Patient Class store patient details such as name, age /* * Field declaration for patient, which stores each input to indicated type * p stands for patient …

Member Avatar for gunjannigam
0
211
Member Avatar for TotalHack

Remove line 81 to 88( the write code) Edit line where u write to file as [CODE] outputStream.println(seatList.get(count)?1:0); [/CODE] Here is the complete code of your ReservationSystem [CODE] package airlinereservationsystem; import java.awt.BorderLayout; import java.awt.Container; import java.awt.GridLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; …

Member Avatar for JamesCherrill
0
160
Member Avatar for gunjannigam

How to draw a circluar arc of given radius say 20 passing from two Given points. I have seen the function Arc2D.Float but can figure out how to find the required parameters for the contructor and also for QuadCurve2D cant figure out the control point.

Member Avatar for james chaco
0
94
Member Avatar for rukshilag

Append this in your code in main function only [CODE] b1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.exit(0); } }); [/CODE] And always use code tags while posting code

Member Avatar for gunjannigam
0
91
Member Avatar for gunjannigam

I have drawn a cirlce and 2 line which intersects the circle using 2D Graphics. Now I want to draw an arc between the intersection point. The attached pic can show very clearly wht i want. The black portion is drawn. The red part is to be drawn. The radius …

Member Avatar for gunjannigam
0
88
Member Avatar for gunjannigam

My problem statement is to draw a map from the given images whose Latitude and Longitude information is stored in database. Initial point Latitude and Longitude is given and then they will change in every 200 ms. I have to plot a map once and on top of the map …

0
64
Member Avatar for Clawsy

Call paintComponent constructor Use this as the 1st line of code in paintComponent method [CODE] super.paintComponent(g); [/CODE]

Member Avatar for Clawsy
0
205
Member Avatar for COKEDUDE

[QUOTE=COKEDUDE;1054893]After I ask the user to enter a number here System.out.println("Enter a number"); number = scan.nextInt(); I would like print the id of each salesperson that exceeded that value and the amount of their sales. I Also want to print the total number of salespeople whose sales exceeded the value …

Member Avatar for gunjannigam
0
3K
Member Avatar for gunjannigam

I have a file which is already written till some lines. I have a blank line at the start of the file and I want to write in that line using Java. I thought creating a FileWriter object by using FileWriter(filename, true) and then a BufferedWriter object will start writing …

Member Avatar for javaAddict
0
104
Member Avatar for gunjannigam

I have a toolbar and various buttons in. There is always a dashed line displyad along the borders on last button clicked. Aslo there are some sliders in my panel. When I try to adjust the value of a slider it also has a dashed border. This border is only …

Member Avatar for javaAddict
0
102
Member Avatar for cute.sridhar

[QUOTE=cute.sridhar;1047049]Hi, I am trying Serial Port Communication in Linux using Javacomm API and RxTx. I'm configured RxTx as per the documentation. But I received an error as follows, Exception in thread "main" java.lang.UnsatisfiedLinkError:com.sun.comm.SunrayInfo.isSessionActive()Z. Would you help me please..[/QUOTE] Did u configure it using this link [URL="http://www.agaveblue.org/howtos/Comm_How-To.shtml"]http://www.agaveblue.org/howtos/Comm_How-To.shtml[/URL] I also tried this …

Member Avatar for gunjannigam
0
216
Member Avatar for gunjannigam

I want to implement the following Task 1) Read till end of file 2) In each Line of the file there is a time mentioned. You need no call a method( code of which I have already written) 3)Wait for the time mentioned in that line of file and then …

Member Avatar for javaAddict
0
86
Member Avatar for gunjannigam

I am trying to read from a text file which of size 1 MB, and contains 5000 lines of data. Following is the code of class which I am using to read from the file [CODE] public class PlayFile extends Timer implements ActionListener{ File filename; BufferedReader out; //float frameid,prev_frameid; public …

0
62
Member Avatar for gibson.nathan

Sorry I dont why are you printing the same value multiple times in your for loop. The value of counter will only increase once And why are you using printf??? If you want to print only till two places of decimal better use NumberFormatter class.And if you want all of …

Member Avatar for gunjannigam
0
129
Member Avatar for jnthn205

[QUOTE=jnthn205;1045644]Im writing this in netbeans. Here is the code: /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package accounttoolssilverberg; /** * * @author Administrator */ public class accountToolsSilverberg { double a[]; int i; public accountToolsSilverberg() { a = new …

Member Avatar for jnthn205
0
88
Member Avatar for vijay_mca

[QUOTE=vijay_mca;1043512]i have created jar file when i am double click jar file i got error could not find main class program will exit i am setting jar properties file mycomputer->tools->folderoptions->filetypes->jdk->javaw i have created manifest file also i am using windows xp operating system can anybody tell wha t is the …

Member Avatar for kvprajapati
0
91
Member Avatar for gunjannigam

I want to draw a battery meter. For this I am painting my panel with Filled Rectangles using AWT Graphics class. Is it possible that I can add a tooltip so that whenver a mouse is pointed on the top of the rectangle a text is displayed(which will be the …

Member Avatar for gunjannigam
0
648
Member Avatar for gunjannigam

I want to know that can I run a code which extend JPanel and uses JFrame without running the x11 server on ubuntu. I read something about Headless but its not working.

0
73
Member Avatar for gunjannigam

I needed to draw an image and paint a needle on it. Since my image is stationary(it doesnt change) I dont want to paint it each time I call repaint. Thats why I thought of using JLabel with an Icon image. The problem is I cant paint anything on top …

Member Avatar for gunjannigam
0
257
Member Avatar for nagatron

Well Couldnt get completely what you wanted. Do u want to create a Panel with this image and Radio Button on it? You can use the paintComponent to paint the image and setBounds method to translate your Button to the exact coordinte you want. But remember for using setBounds method …

Member Avatar for nagatron
0
198
Member Avatar for jrosh

(1)You can make you own Color Using Color Class Constructor with RGB Values. Search for Exact Color value you want You can use new Color(100,149,237); or adjust these values as per your requirement (2) You can use paint method to paint your image maybe this can help [CODE] import java.awt.*; …

Member Avatar for moggz
0
478
Member Avatar for slatk3y

[QUOTE=slatk3y;1001013]Hey, I have a question about Java Applets. I wrote a small applet(just one file) and could run it in my web browser, by making this html file: [code=html] <APPLET CODE="MyApplet.class" WIDTH=400 HEIGHT=400> </APPLET> [/code] And it worked just fine. I am going to make a bigger project and I …

Member Avatar for gunjannigam
0
102
Member Avatar for gunjannigam

I am using Java Comm API to send some data on Serial Port and Again Checking it back. The Problem is that I am not able to get the correct data back always. Sometime I see a garbage value there. Here is my Code Setup SerialPort For Sending Data [CODE] …

0
54
Member Avatar for gunjannigam

I want to add a splash screen to my application. The problem is that whatever splashscreen I have seen on net are basically extending JWindow/JFrame and My application extends JPanel. Now Due to this I am not able to display my application after SplacshScreen is complete.

Member Avatar for BestJewSinceJC
0
43
Member Avatar for gunjannigam

I want to create a custom NumberFormat which returns empty string for negative values and the double number iteslf for +ve and zero values. Please guide me....................

Member Avatar for gunjannigam
0
168

The End.