david foley

Ranch Hand
+ Follow
since Dec 01, 2012
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by david foley

K. Tsang wrote:You need to get only one URL each time.

Looking at your for loop, you seem to be missing the index

Or you may just want to use the for-each loop.

Edit: how come you for loop is
int x=0; arrayImage.size()<x; x++

rather than
int x=0; x<arrayImage.size(); x++


I change it to For Each

Getting No Errors but not able to see Icons.. might just leave it off
9 years ago

Darryl Burke wrote:

david foley wrote:So a am able to get the URL Link but getting that to a Image seems to be the problem

I would expect that to throw a MalformedURLException.

I am getting

But Get No Error when i have it this way
9 years ago
Hi i am currently creating a Twitter Application within Java Swing using JSON

i have the JList populating with Home feeds but i also want to get Images displaying next to the Text

currently all i am getting is

So a am able to get the URL Link but getting that to a Image seems to be the problem

9 years ago

Campbell Ritchie wrote:I can see another problem, I am afraid. Again you will never be able to fill that array. I think you are going to have to try that method and see what happens.

it was a two second job.. to point Sarah Candor in the right direction.. what you pointed out should help her with her project.
9 years ago
you could try something like

This is Un-Tested
9 years ago

currently I am watching java bean youtube vidoes would you recommend any

so the hbm2ddl only creates the tables, you cant use it to query the tables?

I havent Tried anything yet, i am looking at a Small project to build..
and was looking at doing the Data Model with Hibernate. what i meant by "manual entering in the queries", was with Hibernate you don't have to use INSERT INTO table_name
VALUES (value1,value2,value3,...); etc you can leave that up to the Auto Build.

but what i would like to know can this "Auto" build feature work with Searching for First name Last Name etc.

without me having to type in something like this

SELECT * FROM Customers

And have them Link that Query up to Text Fields.

I want this to be done only with Jpanels / jFrames i have yet to look at Spring or Struts to build something like this into a Web Application..
Hi all,

is there a way to use Hibernate with Swing without manaul entering in the Querys ?

What i would like is to have Hibernate.cfg.xml to look after the database Tables along with CRUD..
by using hbm2ddl.auto..

Within my Jpanel if i have two Buttons Next and Back would hbm2ddl.auto work with this to populate the JTextField with the Info.
Just wondering if some one could help me out with this, my list view is populating from Text File, when i use...
ArrayAdapter<String> adapter = new ArrayAdapter<String>(getActivity, android.R.layout.simple_list_item1, ListItems);

but what i would like to do is get the ListView populating with the Model Class,
which would then all me to click on an element inside the list view to send the URL across to another Activity class. so i can use WebView

my Text file looks something like this

all in the one line



9 years ago
Ok i am wondering what is the best way to go about this i am trying to have a Top Fragment and a bottom fragment,

The Top Fragment should Save String inside an EditText to a File Refresh send a Refresh request to the listveiw the list view should read the Text File and place the Text into the List View

The problem i am current having is with the Fragments
InputStream instream = openFileInput("myUsers.txt"); is telling me openFileInput cannot be resloved
this error is also happening in the Adduser Class
FileOutputStream fileOutputStream = c.openFileOutput("myUsers", Context.MODE_PRIVATE);
fileOutputStream cannot be resloved.

9 years ago

I got it Working,
I closed the brackets and then check if its Less then par.

9 years ago

I Tried the isEmpty Method,

Its the Fact that my Edit Texts are set to Int, and when i go to Delete a value inside the Edit Text it tries to Set "" which is giving me the Error even if i take out

it still tells me
java.lang.NumberFormatException: Invalid int: ""
at java.lang.Integer.invalidInt(Integer.java:137)
at java.lang.Integer.parseInt(Integer.java:358)
at java.lang.Integer.parseInt(Integer.java:331)
at com.example.dfoley.scorecard1.Score.hole1(Score.java:15)
at com.example.dfoley.scorecard1.MyActivity$1.afterTextChanged(MyActivity.java:62)
at android.widget.TextView.sendAfterTextChanged(TextView.java:7424)
at android.widget.TextView$ChangeWatcher.afterTextChanged(TextView.java:9194)

what i cant get is if i take that bit of code out this part works fine
public void ButtonClear()
9 years ago

The Text field only accepts Numbers, as pre. set inside the XML, i tried something in the lines of

but giving me the same issue when i try to hit the Delete key on that
9 years ago

Sorry, What i should have saiid is,

When i first Run the Program, and Enter in 3 or 6 it changes color to match the if Statments,

The problem is when i go to Remove the number inside the Edit Text then it will crash.
9 years ago
i am trying to get this part of my App working,

but it keeps giving me a java.lang.NumberFormatException: Invalid int: ""

@ a += Integer.parseInt(MyActivity.Hole1.getText().toString());

what i would like to have is if my number is less then 3 set text to Red or if its greater then 3 set text to Blue.

from my Code i am setting Sum to equal Hole1 but if Hole1 is Emtpy its not

My Activity.java class
9 years ago