Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

~18.8K People Reached
Favorite Tags
Member Avatar for efth

public class ClickListener implements ActionListener { public void actionPerformed(ActionEvent e) { System.out.println(e.getSource().setText("Changed")); } } Eclipse tells me that `setText()` is undefined for type Object. This tells me that `getSource()` doesn't actually return the JButton object. How do should I do this then? How I change the text of the clicked …

Member Avatar for efth
0
17K
Member Avatar for efth

I have some functions that I frequently use in a file called customLib.js. When I want to use one of the functions I copy its definition to the script where I want to use it. Could I upload it somewhere, like dropbox, and use a dropbox url as the src …

Member Avatar for gon1387
0
116
Member Avatar for efth

I tried to rotate an element by changing the CSS using this code: elem.style.-moz-transform:rotate(45deg); It didn't work, and yes, I'm using firefox to test it. How should this be done?

Member Avatar for JorgeM
0
141
Member Avatar for efth

I have it set up so that onclick (on a picure) calls the following function: function nxtimg(country){ document.getElementById("imgcont").src="images",country,"/",imgs[i],".jpg"; i++; } When I click on the image however, accorfing to firebug, the src of the image is; "images". It should have been changed to something like: "images/a/flag". Where did I mess …

Member Avatar for theHop
0
261
Member Avatar for efth

Let's say I have an array/arraylist(doesn't matter) with the following content: 2, 2, 2, 4, 5, 5, 8, 8, 8. How wold I go about counting the different values, in other words; how would I find out that there are 3 twos, one 4, 2 fives and 3 eights. How …

Member Avatar for piyush09
0
315
Member Avatar for efth

Let's say I have a method called 'test' which should return the arraylist called 'theList' containing X number of Integers. How would I do that? public static void test(){ SOME CODE ... return theList } What should 'void' and 'theList' be replaced with in that code to make it work?

Member Avatar for efth
0
308
Member Avatar for efth

I'm quite new to Javascript but thought that I should challenge myself to use it to solve an old problem of mine. I'm trying to set the height of a div to the same as the width of it. Example: The width is set to 50% and the screen is …

Member Avatar for JorgeM
0
275
Member Avatar for efth

This is the css of a navigation bar I've made: header{ width: 85%; display: block; margin-left: auto; margin-right: auto;} #nav{ width: 100%; float: left; margin: 0 0 3em 0; padding: 0; list-style: none; background-color: #6E6E6E; border-radius: 10px; border-bottom-right-radius: 50px; border-top-left-radius: 50px;} #nav li{ display: inline; float: left; position: relative;} #nav …

Member Avatar for JorgeM
0
226
Member Avatar for efth

I recently left Python behind to pick up Java. In Python, a variable defined in a function could not be called outside of the function. But you could at least let the function return a value, which could be a variable defined in the function. When a variable is defined …

Member Avatar for jLocke
0
250
Member Avatar for efth

What I want to accomplish is to have one division with the first part of the text red and the second part green. How would I do that?

Member Avatar for JorgeM
0
79
Member Avatar for efth

I'm very new to all of this, here's the code. f="/home/name/Desktop/text.txt" fil = open (f,"r") data = fil.read() i=int(data) fil.close() import os os.remove(f) i=i+1 inp=file(f,'w') inp.write(i) inp.close() I'm pretty much trying to make the value in the text file increase by one each time the script is run. I realize …

Member Avatar for TrustyTony
0
167