195 Posted Topics
Re: if you mean the margin/padding over the h block, that would come from browser's default css rules and may differ from one browser to another, if you want to make sure every browser display stuff as close as possible to what you would like (it's impossible to have EXACTLY the … | |
Re: [QUOTE=ndrichim;1749973] songet[1]="1.Adele-Someone like you ";//songet e secilit indeks songet[2]="2.Elton John-Sorry seems to be the hardest word ";//... songet[3]="3.Beyonce-Halo ";//kemi lene hapsira pas cdo string songe songet[4]="4.Rihanna-Cheers ";//..qe teafishohen ne vije te drejte ne fund songet[5]="5.Metallica-Unforgiven "; songet[6]="6.Bon Jovi-Runaway "; songet[7]="7.Linkin Park-Iridescent "; songet[8]="8.Michael Jackson-They really don't care about us"; songet[9]="9.Michael … | |
Hello, I am currently creating a master page with a fixed with of 960px, under the header i have a left column, a placeholder, and a right column, all 3 are set to float:left; and have fixed widths of respectively 150 , 615 and 195 pixels. The page displays perfectly … | |
Re: it probably has to do with how paintComponent gets called "randomly" , im no expert on the subject but my guess would be that the button doesn't get painted before you freeze the thread, and then by the time between the thead awakes from the sleep and it decide its … | |
Re: no : [CODE] private int BIG_BOX = 100; private int SMALL_BOX = 50; [/CODE] in the animatedObject Class you only want general variables that would apply to any object of that class, like width and heigth, the small and big values are gonna be assigned separatly on 2 AnimatedObject objects … | |
Re: from a quick look id say the problem is that you are adding the annonymous internal mouseListenner to JButton "b" [I]INSIDE[/I] the JTable's mouse clicked event. So when you click the button before selecting a row, nothing happens because no listenner have been added to it yet. | |
Re: you want a combobox at the bottom of your frame with "all" the content related to an employee? id + name + etc etc ? and why? btw i made your program crash :( there are InputMismatchExceptions when reading the file, at first because i only entered 1 name not … | |
![]() | Re: also your "System.out.print("\nWhich account <1 to " + account.size() + "> do you wish to use? ");" is not in the loop... but definitly "} while(!true);" is asking for problems if you don't have a "break;" statement ![]() |
Re: if you *need* a stack for your assignement then go for it, but as far as i can see the recursive solution that you are using is fine, the thing is you are printing out "(Sum of squares is "+square)" inside your ss() method while really you would want to … | |
Re: Are you just asking about the layout structure or how to implement the dynamic side of the main section? the layout is pretty easy , simply use a structure of divs, the top section could be from the page itself or if you are using a master page then it'd … | |
Re: [QUOTE] Feet Meters Feet Meters --------------------------------------------- 1 3,05 | 20 65,57 [/QUOTE] i don't get any error either, but your convertions are inversed, the day im 17.08 meters tall isn't anywhere near ;) | |
Re: here is the first part of your problem : [CODE] ... } while (LoopEnd <= HowManyNumbers); //at this point LoopEnd is BIGGER than HowManyNumbers, //because you exited the do-while ... calculateSum(HowManyNumbers, InputNumbers, LoopEnd)); } public static double calculateSum(int HowManyNumbers, double InputNumbers, int LoopEnd) { double calculateSum = 0.0; int sum … | |
Re: its an anonymous internal(inner) class, wikipedia didn't have a very helpful description for those but i think this article explains them pretty well, i didn't read it all but from the diagonal sampling i did it looks complete :P [URL="http://www.javaspecialists.eu/archive/Issue002.html"]anonymous inner class[/URL] | |
hello, i figured this forum was more appropriate for this thread than the javascript forum, here is why : my javascript is functionnal, and does not set/change css rules of the objects i manipulate. But here is my problem, i have 2 dynamic listbox (selects with size 10ish) with 4 … | |
![]() | Re: the main issue is you use output and i for all 3 loops but never reset their values correctly before each different loop style (except for the "for" loop which does that by design), try setting output to an empty string after you print it out and this way they … ![]() |
Re: what hidde said, definitly, also your random number generation probly works but it would be more "appropriate" to use the "logical" way to set their value : [CODE] number = (int)(Math.random()*30+1) [/CODE] what i mean by logical is if you were to translate both ways to pseudo code, the one … | |
Re: have you tried setting clear ? depending if u fix the width of your wrappers or not you might need to clear:both; instead of clearing just left or right. also just a personnal opinion but i usualy set all columns in my site float left with display:inline; | |
Re: i haven't played with files for a long time but i believe your problem is the opening of the same file twice, once as readonly and once as write only. perhaps finding a way to open the file only once as read&write would help you do.... whatever it is you're … | |
Re: I'm not entirely sure this is politicaly correct! haha [CODE] System.out.println(player1 + " " + "you are BLACK." [/CODE] | |
Re: [CODE] if(condition){ } else{ } [/CODE] is valid but this isnt : [CODE] if(condition){ } else(condition){ } [/CODE] try using this instead : [CODE] if(condition){ } else if (condition){ } //optionaly add : else{ } [/CODE] little extra comment : i prefer declaring my loop variables inside the for statement … | |
Re: I'd put all the variables as ints since you dont want the user to enter that he has 1.5 dollars , and 2.6 quarters etc... then in a double variable, add each ints multiplied by their % value of 1.0 dollars quarters are 0.25 , pennies are 0.01 etc [CODE] … | |
Re: you can actually pass a statement viewed as a boolean expression to a method the same way you would to an if statement, but the method needs to be programmed to receive a boolean value as argument, because the statement will be evaluated before its final value is given to … | |
Re: [CODE] // Class called ConnectionManager class ConnectionManager { Object[] connecter = new Object[5]; //make it a Connection array (create a Collection class that user can't instanciate. private ConnectionManager(){ } static ConnectionManager connecter(){//dont call the method the same name your variable is called, just bad practice return new ConnectionManager();//not what you … | |
Re: If the information you want to block is sensitive, I would suggest finding a better way to hide it, like asp.net and form logins in the web.config or whatever, but just a content block is easily moved with modern browsers using their developement tools (f12 or Ctrl+Shift+I with chrome) and … | |
Re: depending on what you need done, i like to program my grids manualy instead of using buttons, lets say when i did minesweeper for fun, it was not a 2d array of buttons, or even a 1d array of buttons in a baglayout. just paint whatever kind of grid you … | |
Re: actually peter his main calls the constructor and everything is named fine, the one thing that could be better is actually assigning the instance he creates to a variable but i dont believe this is what his issue is. Person192's problem comes from the fact that he declares his JPanel … | |
Re: sounds like you just need to overwrite the toString() method for your complexNumber class. i dont know what variables you have in a complexNumber class but lets pretend its just 2 ints called iPartI and iPartJ : [CODE] public class complexNumber{ private int iPartI; private int iPartJ; public complexNumber(int i … | |
Re: before writing code, come up with a plan of what you want to do, obviously theres no function that returns the value that comes back the most often in a list, otherwise it wouldnt be an assignement , so pick up and pen and paper, take your list, and find … | |
Re: first : [CODE] // Array is empty if (count == 0) { // Add first vehicle to list array[0] = v; count++; } // Array has Vehicles in it if (count > 0) { [/CODE] use else if instead since right now if you get in there with count ==0 … | |
Re: you could refer to other similar posts aswell for help. heres a post where i posted my opinion on cross form communication. [URL="http://www.daniweb.com/software-development/csharp/threads/405998/1733680#post1733680"]here[/URL] | |
Re: You add the number you enter to the total before the while checks if its value is -1. you should start number at 0 like you do for total, and switch both lines in your do-while, this way, on the first run through it will add 0 to the total. … | |
Re: [QUOTE=jwenting;1734227]that's not random... A random distribution can have multiple of the same number in it :)[/QUOTE] I think what James meant is you could populate it manualy with numbers from 0 to 100 and THEN shuffle it, which would give the same effect your program did without possibly waiting a … | |
Hi, I am currently taking care of a website that goes back to 1997 and mostly all programmed with Asp 2.0 and vbscript, while i keep the pages in Asp 2.0 when i have to update them, this week i had to implement some new pages, and since we are … | |
Re: I would most likely use a JPanel for such a functionality. I would set up a method to fill and one to empty and call them from the mouseEntered() and mouseExited() calls like [CODE] private JPanel myPanel(); private void fillMyPanel(){ //add stuff here myPanel.add(...); } private void emptyMyPanel(){ myPanel.removeAll(); } … | |
Re: [QUOTE=Empireryan;1733800] I know that there are no pointers in java, [/QUOTE] Actually it's been a while but if my memory is right, pretty much everything in java IS a pointer, under the hood. There are ways to hard copy or "clone" variables but by default, everything is gonna be referenced. … | |
Re: [QUOTE=Pri Bhowmik;1733610]Simple Use Static Keyword ex :// //Form1 [CODE] class form1 { public static string mydata=""; public void buttonclick(sendr,e) { mydata="Hello"; } } //settingsform MessageBox.Show(form1.mydata); [/CODE][/QUOTE] I disagree with this method because the children form should not directly access it's parent. One better way of passing information from the child … | |
Re: to expend on what james said : if the A class is only ever gonna have 1 alarm ID at a time, you are indeed able to create a static method "getAlarmId()" it needs to be static to be called from the Class name itself [CODE] Class A{ private int … | |
Re: show us some of your pseudocode so we can see if theres something wrong with that first | |
Re: if you want your 2 ad columns to extend perhaps i would try setting their height to "100%" but honestly from my small experience with css i doubt the height itself is your main problem,(and i doubt inherit would be of use here) perhaps there is something wrong with your … | |
Re: km2011, if i understand there should be 10 students with 5 scores each correct? in this case you would not need 10 columns , also for your "for" statements you probably dont want to hardcode the upper limits, you should go untill "x.lenght" and "x[row].length" instead. as for your populating … | |
Re: what you could do is keep "points" for each player which determines their chances of getting picked. arrayPoints starts with 10 in every field and everytime a user high fives someone, the field corresponding for that player increases by "x" points, if you wanna double his chances you would add … | |
Re: [CODE] while(chr != -1) { chr = in.read(); } System.out.println(chr); [/CODE] you print "chr" after the while which only exits when chr is equal to -1 so the println should always print -1 | |
Re: 1) Like Stultuske stated, your main method is empty [CODE] public static void main (String []args){ } [/CODE] 2) Why would you use the * operator on a string? [CODE] String []name= { "Zero"*10,"One"*10,"Two"*10, ... [/CODE] 3) Why would you set the first String in your array to your welcoming … | |
Re: heres a little idea of what it could look like, i didnt take the time to make it fetch the string from a file but it would be rather easy to implement as well! good luck! [CODE] import java.util.regex.Pattern; public class EmailParser { private static String s = "xxxx@xxx.com; hello@gmail.com; … | |
Hi, I've created this account several years ago while in college and I would like to change my username to something more appopriate since I am now working as a programmer-analyst rather than just studying programming (TGI being the short name of the course i followed) If an administrator would … |
The End.