3,927 Posted Topics

Member Avatar for cocotugo

Well, what problems are you having? What errors if any? Posting several lines of abbreviated variables and equations and saying "it's not right" is a bit vague.

Member Avatar for cocotugo
0
95
Member Avatar for Software guy

Ok, 2 main problems with the method that creates your array - see comments in the code belowe[code] int[] Array1= new int[size]; // you are changing 'size' in this loop // use a new variable in the loop [B]for(size = 0;size <=(size-1);size++)[/B] { // casting Math.random() to an int will …

Member Avatar for Software guy
0
155
Member Avatar for Futbol10

And please include the code in post with [noparse][code] [/code][/noparse] tags. Many people, myself included, do not want to mess with attachments to glance at your code.

Member Avatar for Futbol10
0
115
Member Avatar for shobhit123
Member Avatar for C41R0

You need to narrow that down a bit or highlight the additions that caused the problem and explain what you are trying to do, because I doubt many people are going to wade through that much GridBagLayout code based on what little you described.

Member Avatar for C41R0
0
306
Member Avatar for Jishnu

Alex is correct. Generics became available with 1.5. And 1.2 is way too old to be using for anything these days.

Member Avatar for Jishnu
0
101
Member Avatar for AppleTastic

Use regex to parse out the links and push them onto a stack, pop the stack, get that page and gather the text or whatever, continue through the stack.

Member Avatar for Ezzaral
0
82
Member Avatar for bops

Place the mouse listener code in your custom tab component and add the listener to that component.[code]class ButtonTabComponent extends JPanel implements MouseListener { private final JTabbedPane pane; private final JButton button; public ButtonTabComponent(final JTabbedPane pane) { ... addMouseListener(this); ...[/code]

Member Avatar for Ezzaral
0
575
Member Avatar for TheWhite
Member Avatar for Ezzaral
0
120
Member Avatar for beelzibub
Member Avatar for Alex Edwards
0
160
Member Avatar for sasidharnet

You cannot seriously think it's a good idea to take code written by others and submit it as your own for an interview. If you cannot complete the project then you should not get the job.

Member Avatar for javaAddict
0
279
Member Avatar for chopram

And is there a particular reason you need a separate controller and don't want the view to serve that role? If you don't have the answer then you probably don't need to. Keep the model separate and let the view interact with it as needed.

Member Avatar for jwenting
0
321
Member Avatar for rrocket
Member Avatar for K?!

The code that Alex Edwards posted will work for that scenario, but the action listener code can become quite long, verbose, and repetitive for your button array. A cleaner way to handle that would be to create a small action class for those buttons, like[code=java]class ColorButtonAction extends AbstractAction{ Color buttonColor; …

Member Avatar for sciwizeh
0
2K
Member Avatar for DAKORACING

You might have better luck posting this (after searching a bit) over in the Sun Java forums that apply to installation issues: [url]http://forum.java.sun.com/forum.jspa?forumID=32[/url] [url]http://forum.java.sun.com/forum.jspa?forumID=14[/url]

Member Avatar for jwenting
0
88
Member Avatar for CK01

The default layout manager is FlowLayout, which is what your JPanel is currently using since you have not changed it. You can change the positions of those text fields all day but FlowLayout won't respect them. It wasn't designed for that. I would recommend using a BoxLayout or GridLayout if …

Member Avatar for CK01
0
102
Member Avatar for sittas87

Yeah, um, lol... or something. This really has nothing to do with feedback on DaniWeb.

Member Avatar for ~s.o.s~
0
124
Member Avatar for Alex Edwards

The Sun tutorial on Reflection is a pretty good place to start: [url]http://java.sun.com/docs/books/tutorial/reflect/index.html[/url] Keep in mind that using reflection to manipulate classes and methods is much slower than normal compile-time usage patterns (and the code is pretty long and unwieldy to boot) and should only be done when you need …

Member Avatar for Ezzaral
0
105
Member Avatar for PL.P27

Futbol10, you already have a thread for this question. Please don't posts requests for help into other posters' threads (especially not old posts).

Member Avatar for Futbol10
0
131
Member Avatar for k_en

Check the doc for [URL="http://java.sun.com/javase/6/docs/api/java/text/SimpleDateFormat.html"]SimpleDateFormat[/URL]. You want to use "HHmmss" instead of "hhmmss".

Member Avatar for masijade
0
170
Member Avatar for Software guy

You may want to use a [URL="http://java.sun.com/javase/6/docs/api/java/awt/geom/GeneralPath.html"]GeneralPath[/URL] or [URL="http://java.sun.com/javase/6/docs/api/java/awt/geom/Path2D.Float.html"]Path2D.Float[/URL] or [URL="http://java.sun.com/javase/6/docs/api/java/awt/Graphics.html#drawPolyline(int[],%20int[],%20int)"]Graphics.drawPolyline(int[],int[],int)[/URL] for this. All of those provide methods to draw a series of points connected by lines.

Member Avatar for PoovenM
0
2K
Member Avatar for ramjeev

There is no built in calendar UI. You will need to create your own or find one that someone else has written.

Member Avatar for Ezzaral
0
65
Member Avatar for funtoosh

[QUOTE=funtoosh;620539][B]Plzz solve my problem......... @JavaAddict-- look through it,plzzzzz[/B][/QUOTE] "Plzz" is not a word. Please have the consideration to use proper English (at least as much as possible if your English is limited) if you are requesting help. Demanding help in bold text with gibberish words is just plain rude and …

Member Avatar for Ezzaral
0
178
Member Avatar for C41R0

After you create the "mainPane", you need to set it's layout to GridBagLayout like so[code]mainPane.setLayout(new GridBagLayout());[/code]

Member Avatar for C41R0
0
93
Member Avatar for TheWhite

[QUOTE=TheWhite;619925]Update Checking: Currently, my program connects to a URL and checks if a new version is available. If one is, it simply opens up a dialog saying a new version is out and to go download it... Is there a way to have it automatically open the path to the …

Member Avatar for TheWhite
0
197
Member Avatar for FaMu

What is the "length" variable? You should be looping to "a.length" over that array. If "length" is not the same as the array length, you are missing parts of your array in the loop.

Member Avatar for FaMu
0
148
Member Avatar for Bouras

If you figured out delete, you can at least get a start on edit. If you run into problems with it, post the code and specific questions or errors that you have. This is your homework - not ours.

Member Avatar for Ezzaral
0
119
Member Avatar for zeimen

I can't believe the degree to which people try to advertise crap on forums in the guise of being interested in the product.

Member Avatar for Ezzaral
0
16
Member Avatar for Dani

[quote=samsathish;423744]show me the link for Dictionary project[/quote] Her code is attached to the first post. Did you bother to read anything at all before posting this question on a thread that is years old? Additionally, your vocabulary could be improved with the addition of some terms of common courtesy such …

Member Avatar for aves
0
496
Member Avatar for darklich13

At the most basic level, you override the equals() method and test whether the object properties meet the criteria that you consider them "equal". Here is a bit more information: [url]http://java.sun.com/docs/books/tutorial/java/IandI/objectclass.html[/url] In practical usage there are more considerations to overriding equals() than just comparing the objects' properties, such as also …

Member Avatar for Ezzaral
0
390
Member Avatar for nelson13

Surely that is not all of the code? Post the rest and please place it within [noparse][code] [/code][/noparse] tags. Also, always use braces around for() blocks. Even though a single statement without braces is allowed after for() and if() statements, you are likely at some point to add additional code …

Member Avatar for nelson13
0
682
Member Avatar for CelestialDog

You are replacing "chatText" with every line that gets read from the stream. I believe you probably want to append the new text to "chatText" instead of replacing it.[code]String response = ""; while ( (response = in.readLine()) != null) { chatText += response+"\n"; }[/code]

Member Avatar for CelestialDog
0
178
Member Avatar for TheWhite

In the mousePressed() method, use the following[code] int bothMask = MouseEvent.BUTTON1_DOWN_MASK | MouseEvent.BUTTON3_DOWN_MASK; if ((evt.getModifiersEx() & bothMask) == bothMask){ // do your thing System.out.println("Both down"); }[/code]

Member Avatar for Ezzaral
0
391
Member Avatar for TheWhite

You are just hitting a resource location problem. Your relative file path is not being found and because of the specifics of getImage() and drawImage(), the only visible symptom is no image being drawn. The MediaTracker that load the image is actually creating an image with no dimensions because it …

Member Avatar for TheWhite
0
100
Member Avatar for ardillo

Please note that Java and Javascript are [I]not[/I] the same thing. Flagging to see if this can be moved over to the Javascript forum.

Member Avatar for Ezzaral
0
76
Member Avatar for Mr.UNOwen

For one thing, override paintComponent() instead of paint() and be sure that you call super.paintComponent() before your custom code. As for the specific of your question, it's a bit unclear. Post the relevant sections or example code that demonstrates the problem behavior.

Member Avatar for Mr.UNOwen
0
254
Member Avatar for coolian

Do not resurrect old threads to ask new questions. Start a new thread if you have a question. Do not use "text-speak" gibberish like "u" and "plzz" in your post. If you are too lazy to type full words then don't expect help.

Member Avatar for Ezzaral
0
203
Member Avatar for slayer10

And... ? You haven't stated a question. Also, why would Movement be a class of it's own? A class encapsulates state and behavior. What state and behavior would be represented by Movement? Edit: It looks like your post got cut off initially and you have added more to it, so …

Member Avatar for Ezzaral
0
200
Member Avatar for hezfast2

I would think your game class would have a variable for number of cards in a hand. The deck class could contain a method deal(numberOfCards, numberOfHands) that returns a Set of Hand instances. This would keep your deck independent of the game and not tied to the specifics of your …

Member Avatar for Ezzaral
0
836
Member Avatar for creativehacker
Member Avatar for greatfindsct

The error also tells you which symbol (name) cannot be found and the line on which it occurs. Please post the exact error text if you cannot locate it based on the compiler information.

Member Avatar for Ezzaral
0
98
Member Avatar for suriname0

Issues that I see: 1) Logic is hard-coded to 3x3 board. Array positions, bounds checks, adjacency checks are using literals in many places. 2) Heavy repetition of if() blocks that are nearly identical, especially in the blocking() method. These could probably be replaced with a parameterized method or by adding …

Member Avatar for suriname0
0
112
Member Avatar for seeker55

Sure, let me write them all up in Word with step-by-step explanations and I'll post them in a few days. Just keep checking back here.

Member Avatar for seeker55
0
98
Member Avatar for NycNessyness

Um, you can 0 to a value all day and it won't change...[code]total = 5; newtotal = 0.0;[/code]

Member Avatar for NycNessyness
0
98
Member Avatar for TheWhite

Yes, focus issues can be a pain with key listeners. The InputMap and ActionMap make it easier to handle this. Try using this instead of the KeyListener.[code]private void launch() { getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put( KeyStroke.getKeyStroke("R"), "reset"); getRootPane().getActionMap().put("reset", new AbstractAction() { public void actionPerformed(java.awt.event.ActionEvent e) { System.out.println("reset"); } }); setBounds(100, 100, 300, 300); add(new …

Member Avatar for TheWhite
0
1K
Member Avatar for tactfulsaint

What exactly are you trying to do on that line of code? It doesn't appear to be a valid statement at all.

Member Avatar for Ezzaral
0
62
Member Avatar for maafipau

[QUOTE=Sirikit Joshi;611684]The problem is I am not very educated in Qbasic and my teacher has given me a project of making a hangman game.[/QUOTE]Yes, that is a problem. The best way to get educated in it is to actually do the assignments you are given.[QUOTE=Sirikit Joshi;611684]If you help me I …

Member Avatar for Narue
0
385
Member Avatar for D boss

None of that code is executed - it doesn't compile. You have missing concatenation operators, illegal calls to non-static members from a static context, etc. You need to fix those first.

Member Avatar for D boss
0
114
Member Avatar for NycNessyness

Not sure what your question is exactly, but maybe these will help: [url]http://exampledepot.com/egs/javax.swing.text/style_HiliteWords2.html[/url] [url]http://java.sun.com/docs/books/tutorial/uiswing/components/editorpane.html[/url]

Member Avatar for NycNessyness
0
138
Member Avatar for dophine

I don't believe you can make the component not fill the cell, but you can add a border to the button in the custom renderer[code]class ButtonCellRenderer extends JButton implements TableCellRenderer { private Border MATTE_BORDER = BorderFactory.createMatteBorder(2, 3, 2, 3, UIManager.getColor("Table.background")); public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, …

Member Avatar for Ezzaral
0
126

The End.