3,927 Posted Topics

Member Avatar for winner126

I can't say for certain what's blocking your UI update, but you could try executing the two statements that update the text fields in a task on the event queue like so[code]SwingUtilities.invokeLater(new Runnable() { public void run() { chatLog.append(forLog); messageField.setText("AWDAW"); } });[/code]That will make sure the GUI update is invoked …

Member Avatar for Ezzaral
0
359
Member Avatar for LianaN

Try [CODE]jScrollPane1.setViewportView(new JLabel("Connecting to the database. Please wait...")[/CODE]and when the table is ready[CODE]jScrollPane1.setViewportView(table);[/CODE]

Member Avatar for LianaN
0
4K
Member Avatar for peter_budo

I don't think you should have to do anything special with it since Java uses unicode by default. Perhaps the file itself is using some other encodiing? Maybe this link could be helpful: [url]http://www.exampledepot.com/egs/java.nio.charset/ConvertChar.html[/url]

Member Avatar for quuba
0
4K
Member Avatar for StaticX

BoxLayout, GridLayout, or GridBagLayout would all work. [url]http://download.oracle.com/javase/tutorial/uiswing/layout/index.html[/url]

Member Avatar for hanvyj
0
147
Member Avatar for LianaN

Take a look through [URL="http://download.oracle.com/javase/tutorial/uiswing/concurrency/index.html"]this tutorial on concurrency in Swing[/URL] SwingWorker invokes a worker thread in the background that does not tie up the event queue. SwingWorker may publish results for updates on the event queue, but it does not have to. SwingUtilities.invokeLater() schedules a task to run on the …

Member Avatar for Ezzaral
0
451
Member Avatar for wowz

Your class outline already has pretty straightforward instructions. Ask specific questions about the parts which confuse you.

Member Avatar for javaAddict
0
102
Member Avatar for cocoll

Then I guess you are out of luck. Seriously, you haven't said why getSource() won't work (it will by the way) and you haven't given any good reason not to define separate listeners. You can define separate listeners as inner classes, anonymous or named.

Member Avatar for Ezzaral
0
91
Member Avatar for WASDted

Judging from all of the people I see staring at them with blank faces, I thought they already were stun devices.

Member Avatar for Ezzaral
0
62
Member Avatar for starfruit

Try this as a starting point: [url]http://download.oracle.com/javase/tutorial/uiswing/components/icon.html[/url]

Member Avatar for Ezzaral
0
41
Member Avatar for Pokenerd

Yes, as Kramerd suggested, you'll need to create the Thread object, setDaemon(), and then start it. The setDaemon() method is a void return, so you cannot chain it as you tried above. If setDaemon() returned a reference to itself then chaining would be possible.

Member Avatar for Pokenerd
0
143
Member Avatar for lee.j.baxter

Take a look at this section on using JList with a mutable model: [url]http://download.oracle.com/javase/tutorial/uiswing/components/list.html#mutable[/url]

Member Avatar for lee.j.baxter
0
190
Member Avatar for serph09

No one is going to answer quiz questions for you. Formulate your own answers and if you have uncertainties, ask specific questions. Explain your reasoning or thoughts on the areas you doubt, Demonstrate some effort in the process if you want others to take their own time to help you.

Member Avatar for Ezzaral
0
139
Member Avatar for purijatin

[URL="http://www.javaconcurrencyinpractice.com/"]Java Concurreny In Practice[/URL] is a good one.

Member Avatar for Ezzaral
0
83
Member Avatar for TahoeSands

Another option would be to create a small ChipStack class that extends JComponent and overrides paintComponent() to render both the stack of chips and the text count as a single graphical unit. It would make positioning on your table a tad easier.

Member Avatar for Ezzaral
0
82
Member Avatar for extemer

>open=fun.java // my program name You cannot run ".java" files. You can run classes or jars.

Member Avatar for ElieM
0
1K
Member Avatar for orkuncanbay

Not only a shame - it's a violation of the rules. Of course, so is begging for homework help without showing any effort. I really don't see why anyone should help him find a program to copy and turn in as his own work.

Member Avatar for Eric Cute
-1
71
Member Avatar for Clarkeez

Yes, as pritaeas mentions, this is answered in your other posting: [url]http://www.daniweb.com/forums/post1384110.html#post1384110[/url] Please do not post the same question in multiple forums. Closing this one.

Member Avatar for Ezzaral
0
76
Member Avatar for The Alchemist

[B]> Recently i offered them to send them a couple of notes, and they never got back to me[/B] Well, there is your answer then. If they ask, just don't get back to them.

Member Avatar for The Alchemist
0
135
Member Avatar for MAGall

Move genRandomTime() outside of main(). You can't declare methods inside methods. You will also need to move the declaration of 'ranGen' out of main() so your function can access it. You can read a bit about sorting a collection here: [url]http://download.oracle.com/javase/tutorial/collections/algorithms/index.html#sorting[/url]

Member Avatar for MAGall
0
205
Member Avatar for sadia.ab

This is not a homework completion service. Post the code that you have done so far and post specific questions or error messages that you are having trouble with.

Member Avatar for Ezzaral
0
91
Member Avatar for Buffalo101
Member Avatar for mangopearapples
Re: Mp3

His comment was quite straightforward. Did you look up JLayer?

Member Avatar for mangopearapples
0
172
Member Avatar for ceyesuma

Arrays do not have a "pop()" method - they are fixed storage. You can null out elements or shift them out of existence.

Member Avatar for ceyesuma
0
320
Member Avatar for sravan953

Use an array and a loop. Next time start a new thread if you have a question. Don't hijack someone else's.

Member Avatar for Ezzaral
0
697
Member Avatar for SgtMe

I think many posts about that end up in Game Development as well.

Member Avatar for Dani
0
163
Member Avatar for ana12
Member Avatar for TheWhite

The default FlowLayout gives you very little control over component sizing/resizing behavior. Try a different layout manager to achieve the behavior that you want: [url]http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html[/url]

Member Avatar for Azeerazly
0
200
Member Avatar for ana12

[QUOTE=ana12] me i lways eating vegetables..[/QUOTE]You could stir-fry them with spam.

Member Avatar for dexter737
-5
219
Member Avatar for ana12

Hey, if you can't pasta the pasta, then pasta you should just pasta pasta.

Member Avatar for dexter737
-11
325
Member Avatar for wowz
Member Avatar for wowz
0
179
Member Avatar for soccer13

I think that is probably only a part of his statement, because without any context of the discussion that doesn't make any sense.

Member Avatar for peter_budo
0
79
Member Avatar for ben.matthews18

Post the exact error message it gives you and perhaps someone can point out the problem.

Member Avatar for drjohn
0
105
Member Avatar for gikonyo

As you have been advised, you must demonstrate that you have made some effort if you want help with homework assignments.

Member Avatar for Ezzaral
-1
56
Member Avatar for computercoder

[B]> Whenever I run this code, there's no input box for the user to input text.[/B] It's a console application - you type in the console. Working as intended. [B]> If I change the "String text = console.nextLine();" to "String text = console.next();" then only the first word is taken …

Member Avatar for Eric Cute
0
106
Member Avatar for TankMontna

You can control that easily by creating a small inner class for your timer action like so[code=java]private class TimerAction extends AbstractAction{ boolean wait=false; public void actionPerformed(ActionEvent e) { if (!wait) { System.out.println("moving stuff"); } } public void wait(boolean wait){ this.wait = wait; } }[/code]You'll need to keep a reference to …

Member Avatar for Ezzaral
0
191
Member Avatar for AaronLLF

Well, from the API doc, it looks like you need to call Keyboard.create() after the display is initialized and before you poll any keyboard state. I've never used that API though.

Member Avatar for Ezzaral
0
882
Member Avatar for vbx_wx
Member Avatar for pokemonlegend
Member Avatar for alastair1008
Member Avatar for Taywin
0
138
Member Avatar for Andy_Parr

There is no need to keep the "distance to" values in your "store" class. Those can be computed on the fly from your mouse locations. You can create a separate method distanceFrom() that computes the distance from a point to a store. It could be on the store class as …

Member Avatar for JamesCherrill
0
640
Member Avatar for Oblivious21

1) You're only reading two ints before you start trying to read and parse strings - how does that match up with your input file? 2) After you've correctly parsed the passenger entry, you know which row and seat to put him in because it is stated as the first …

Member Avatar for Ezzaral
0
160
Member Avatar for hassancool

If you have a question, post it along with the code. If you're wanting to pay someone to do it, create a thread over in the Looking To Hire section.

Member Avatar for hassancool
0
155
Member Avatar for unikshegz

Is that code inside a method? Post the entire code in [noparse][CODE][/CODE][/noparse] tags.

Member Avatar for Ezzaral
0
93
Member Avatar for Newskin01
Member Avatar for barthdesv
Member Avatar for barthdesv
0
81
Member Avatar for LianaN

[B]> However, it doesn't work - the error message is generated for the empty set.[/B] I assume you meant the error is [I]not[/I] generated. An empty result doesn't throw an exception because it's a completely valid result - there simply are no records that match the query. If your code …

Member Avatar for LianaN
0
632
Member Avatar for purple21

Closing this thread since the poster has not returned in a month to clarify what he needs help with and this is not the place to solicit business offers.

Member Avatar for Ezzaral
0
100
Member Avatar for alwinnjavaroor

You could code a static method for it in a utility class[CODE]public class Functions{ public static float f(float x){ return x*x*x+6*x; } }[/CODE] Anything you do is going to be a method call. You don't need to create any references to use the above, but then again you give up …

Member Avatar for Ezzaral
0
99
Member Avatar for Katana24

You can use those methods to set your component locations if you set your layout to null. If you move the component, you won't need to use the graphics methods. If you want to use the graphics methods instead, you could make a small banner component that paints the moving …

Member Avatar for Ezzaral
0
106
Member Avatar for wolfcode

There are no macros in Java. You would define a class or interface constant for that purpose.

Member Avatar for alwinnjavaroor
0
391

The End.