3,927 Posted Topics

Member Avatar for JRDJ12

In calculating the average, you sum the elements and then divide by the number of elements. That would imply that division does not occur within the loop.

Member Avatar for Ezzaral
0
2K
Member Avatar for jhoop2002

I'm sure that jhoop would have appreciated this information two years ago.

Member Avatar for ashutoshbajpaij
0
1K
Member Avatar for spades0001

Once you have a selected File object, you can create an ImageIcon and display it in a JLabel on your frame. Take a look through this tutorial for more information and some sample code: [url]http://docs.oracle.com/javase/tutorial/uiswing/components/icon.html[/url]

Member Avatar for mKorbel
0
247
Member Avatar for begueradj

What is to go in the rectangles? You can place JLabels in a GridLayout and give them a line border if you want a grid of actual components. Or you can simply override paintComponent() and draw lines on your JPanel. The Oracle tutorials offer more information about both of those …

Member Avatar for begueradj
0
2K
Member Avatar for P00dle

Have you looked into the error [iCODE]Invalid object name 'tCandidate'.[/iCODE] Is it a valid object?

Member Avatar for Ezzaral
0
659
Member Avatar for mariosman

Perhaps you should read the following rule from our forum rules and revise your post accordingly: [B][I]Do provide evidence of having done some work yourself if posting questions from assignments.[/I][/B]

Member Avatar for mariosman
0
117
Member Avatar for aanders5

As is often the case, the Oracle tutorials have you covered: [url]http://docs.oracle.com/javase/tutorial/uiswing/misc/timer.html[/url]

Member Avatar for Ezzaral
0
188
Member Avatar for Mehnad

Both of your returns are in conditional statements. The compiler requires a guaranteed return value for all possible conditions. Add a default return value at the end to cover the case of your other conditions not being satisfied.

Member Avatar for Mehnad
0
460
Member Avatar for Jade4127

To use composition in Cylinder, you would add a Circle instance variable instead of extending Circle. When you need any circle info, you make the calls on your circle reference instead of inherited methods. So for example, where are calling [ICODE]findArea()[/ICODE] in the findVolumne() method, you would instead call [ICODE]circle.findArea()[/ICODE]. …

Member Avatar for fausto1234
0
549
Member Avatar for jaxi

"=<" is not a valid operator. Also, all for() loops must have three sections ( ; ; ) even if one is not used

Member Avatar for jaxi
0
200
Member Avatar for th3b3n

In your listener, you can get a reference to the clicked object with[ICODE]e.getSource()[/ICODE], which you can then cast to [ICODE]JCheckBox[/ICODE]. You can toggle your variable values based on [ICODE]JCheckBox.isSelected()[/ICODE].

Member Avatar for th3b3n
0
226
Member Avatar for asif49

You were already advised in [URL="http://www.daniweb.com/software-development/java/threads/395899/1698414#post1698414"]your other thread about this[/URL] to look at regex. I don't see any regex or mention of it here.

Member Avatar for ~s.o.s~
0
150
Member Avatar for besjana

Post your code and specific questions. The forum rules state that you must show some effort if you wish to get help with homework.

Member Avatar for zeroliken
0
187
Member Avatar for th3b3n

If the path of the filename cannot be found relative to the directory in which the program is executing, you'll need to provide a more complete path to the file. You didn't post the error message, but it sounds like a FileNotFoundException?

Member Avatar for th3b3n
0
292
Member Avatar for BDan

GridLayout maintains equally sized grid cells along the horizontal and vertical. If you need to vary the size of the cells, you'll need to subdivide your layout into multiple panels with their own groups of controls or use a [URL="http://docs.oracle.com/javase/tutorial/uiswing/layout/gridbag.html"]GridBagLayout[/URL]. GridBagLayout is a lot more flexible, but it's also much …

Member Avatar for BDan
0
172
Member Avatar for Kayneedshelp
Member Avatar for Ezzaral
0
241
Member Avatar for zainshah120

I would imagine you'd need to [URL="http://wordpress.org/download/"]install Wordpress[/URL] locally on your Apache server?

Member Avatar for Ezzaral
0
280
Member Avatar for applejax77

Looks to me like you just want to set the text of your text fields back to zero or empty. You can just call setText(String) on each of them.

Member Avatar for applejax77
0
9K
Member Avatar for spades0001

You'll need to use a JTextPane if you want to mix text and pictures in the same component: [url]http://docs.oracle.com/javase/tutorial/uiswing/components/editorpane.html[/url] You can use a JLabel and ImageIcon if you just want to display the picture by itself: [url]http://docs.oracle.com/javase/tutorial/uiswing/components/icon.html[/url]

Member Avatar for Ezzaral
0
143
Member Avatar for asif49
Member Avatar for daniahmed

It might help if you noted which line was 75 in your file, since you only posted 38 lines of code.

Member Avatar for daniahmed
0
135
Member Avatar for coolsport04

You could make your own PaintShape class that contains a Shape reference and those two properties. You can pass all of the info through the constructor and access it as you loop through your shapes in the paintComponent() method.

Member Avatar for Ezzaral
0
215
Member Avatar for kiaski

Look at lines 24 and 25, then consider what will happen with those values in your loop condition on line 27.

Member Avatar for Ezzaral
0
257
Member Avatar for skylinepkr
Member Avatar for Ezzaral
0
118
Member Avatar for BDan

Posting code from attachment for others' convenience: import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.io.*; import java.util.*; import java.text.*; class ExampleJComboBoxSample extends JFrame implements ActionListener, ItemListener { private static final int FRAME_WIDTH =1000; private static final int FRAME_HEIGHT =1000; private JComboBox comboBox1, comboBox2; private JTextField parentinput, emailinput; public static void …

Member Avatar for Ezzaral
0
169
Member Avatar for maurya10

Ask this guy what he found with Google: [url]http://www.daniweb.com/software-development/java/threads/395869/1698277#post1698277[/url] After that, post your code and ask specific questions about what you are having difficulties with.

Member Avatar for Ezzaral
0
72
Member Avatar for nchy13

No. If you're too lazy to Google such a basic concept, why should someone else put forth the time to spoonfeed it to you? If you have [I]acutal questions[/I], after putting in the slightest effort yourself, post them here with whatever code you have started with.

Member Avatar for Ezzaral
0
362
Member Avatar for diafol

Oh, you got the hard one. The easier one asks what color his brown horse was...

Member Avatar for jonsca
0
551
Member Avatar for lbgladson

Check the scope of your 'listener' variable where you are initializing it. Your listener is not being called at all. After that is corrected, you need to figure out how to specify the color, because there is no Color constructor for the name of the color.

Member Avatar for Ezzaral
0
105
Member Avatar for Clzeigler
Member Avatar for crazymidget01

Add [iCODE]e.printStackTrace();[/iCODE] in your catch block, so you can see more details of the error.

Member Avatar for thines01
0
138
Member Avatar for lbgladson

Use an ActionListener instead of ChangeListener for your buttons. You can pass the color you wish to change to as a parameter to your setSampleColor() method. Set the panel background to that color before repaint.

Member Avatar for Ezzaral
0
5K
Member Avatar for abhishekarora

It depends on the database that you are using. Different databases have different ways of dealing with auto-incremented keys like that.

Member Avatar for ~s.o.s~
0
97
Member Avatar for ERINY

3 separate threads for this single question merged. Apologies for some slight discontinuity, but if ERINY hadn't decided to string this out so much it would be more linear.

Member Avatar for TrustyTony
0
1K
Member Avatar for mcspud

Which part is confusing you? What have you tried? What have you thought about trying? From the [URL="http://www.daniweb.com/forums/faq.php?faq=daniweb_policies"]forum rules[/URL]: [I]Do provide evidence of having done some work yourself if posting questions from school or work assignments[/I] Simply dumping your assignment here is not evidence of effort.

Member Avatar for mcspud
0
139
Member Avatar for Daigan

You need to have a guaranteed return value. Currently all of your returns are dependent on one of the if() clauses being true. If none of them end up true, there is no final return. If you put a default return at the end of the method, you will make …

Member Avatar for Daigan
0
71
Member Avatar for maverick420

Look at where your while() condition is located. Now trace through what your program will do if input is 1-6.

Member Avatar for stultuske
0
250
Member Avatar for chinee

MySql is a database, not a user interface. A drop-down box is an interface component.

Member Avatar for chinee
0
62
Member Avatar for eddy556

Use [icode]( ! "hello".equals(someString) )[/icode] edit: Yes, same thing striker just posted :)

Member Avatar for stultuske
0
760
Member Avatar for writeout

You're going to have to show more effort than that if you expect any help. Ask specific questions about the parts you are struggling with.

Member Avatar for CSloan7597
0
299
Member Avatar for jhamill

You could use the [URL="http://download.oracle.com/javase/6/docs/api/java/awt/Graphics2D.html#scale(double,%20double)"]Graphics2D.scale()[/URL] method, which scales the entire graphics transform or you can just add a scale multiplier to all of the dimensions of your drawn objects. You'll probably want to use a float for the scaling factor. I'd also recommend using a JPanel and overriding paintComponent() for …

Member Avatar for mKorbel
0
1K
Member Avatar for javaAddict
Member Avatar for gunjannigam

You could take a look at [url]http://java.freehep.org/demo/LegoPlot/[/url] which is a demo of the 3D plotting package in [URL="http://java.freehep.org/"]FreeHEP[/URL].

Member Avatar for AppB
0
144
Member Avatar for lele07060
Member Avatar for vinod_javas

You can use a lock file in your base directory as well. We use that here at work for one particular app that should only be running a single instance. I hadn't thought about a socket binding though. Interesting alternative.

Member Avatar for peter_budo
0
6K
Member Avatar for akingcool

Well, the only relevant part you have is [CODE]import java.io.*; in = new BufferedReader(new FileReader(new File(filename))); [/CODE] These may help: [url=http://www.exampledepot.com/egs/java.io/ReadLinesFromFile.html]ReadLinesFromFile[/url] [URL="http://www.regular-expressions.info/java.html"]Regex tutorial[/URL]

Member Avatar for akingcool
0
419
Member Avatar for seanbl1

Please be aware of the following forum rule: [B][I]Do provide evidence of having done some work yourself if posting questions from school or work assignments[/I][/B] Post your code and specific questions about what is troubling you and what you have tried.

Member Avatar for JeffGrigg
0
107
Member Avatar for herstein

Yes, the method will operate on whatever data array you have passed it.

Member Avatar for herstein
0
114
Member Avatar for pc4fay

This forum is for helping those who have questions. It's not a code-on-demand service. If you have specific questions or a css you need help with, post them.

Member Avatar for Ezzaral
0
123
Member Avatar for techyworld

Nope. Re-read your notes. You've been told exactly what data the class will hold. It's trivial to at least start a skeletal attempt with that.

Member Avatar for jackmaverick1
0
100

The End.