« first day (534 days earlier)      last day (4397 days later) » 

12:41 AM
hello
 
 
2 hours later…
3:00 AM
Anybody home?
 
3:42 AM
User?
 
 
8 hours later…
11:27 AM
@TimothyPerez
@LewsTherin
any one there?
 
What's good?
 
I have query
on plain java only
 
Ok maybe I can help..
 
11:29 AM
as i am not sure what is the good solution for its implementation
i have code like (i have 24 loops like this for 24 time format)
//this sets the summary event against a time
Vector data = (Vector) listEvent.get(keys);
for (int i = 0; i < data.size(); i++) {

if (time.getText().equals(sTime)) {
System.out.println("equal");
desc.setText(Summary);
}
if (time1.getText().equals(sTime)) {
System.out.println("equal 1");
desc1.setText(Summary);
}
}
now since i have two events for the same time ic annot just use desc.setText it gets overridden
so i taught to use a vector in each loop and add the data ,but since i have 24 for loops
do i have to create 24 vectors?
if (time23.getText().equals(sTime)) {
eventVector.addElement(Summary);
desc1.setText(Summary);
}
 
a sec.
 
like this
 
what is desc
 
its a kind of label to which i am setting data
 
Alright so each iteration the label gets overwritten?
 
11:33 AM
ya
so taught to use a vector
 
Do you want to display all the info or just one at a time?
 
but i have 24 such loops
i need all the info for a given time
 
So how will a Vector help?
 
if (time23.getText().equals(sTime)) {
eventVector.addElement(Summary);
desc1.setText(Summary);
}
i have to crete 24 new vectors in each loop
 
Oh it is an array
ok I see
 
11:35 AM
but a bad soltion
 
Not really.
If you are not deleting as often as you insert a vector should be fine.
 
it will make the application heavy
24 vectors
any other option?
 
You don't get 24 vectors
You get one vector
 
how?
 
and to that vector you add 24 elements
 
11:36 AM
see in each loop it can match
 
So you have something like this
Vector vector = new Vector()
loop
if true
vector.Add(something)
end loop
Yeah?
 
if (time22.getText().equals(sTime)) {
System.out.println("equal 22");
desc22.setText(Summary);
}

if (time23.getText().equals(sTime)) {
System.out.println("equal 23");
eventVector.addElement(Summary);
labelField[i].setText(Summary);
}
here syso 22 also gets printed n 23 also
i need data from both,but both will have data differently
 
Do you actually have 24 variables like time1, time2, time3?
 
ya rite
 
Can you put your code in pastebin?
 
11:39 AM
24 if loops
 
That sounds wrong..
 
that loop is redundant sorry
well i guess you are using for that label
 
ya rite
 
but it would be better to just have a list of of labels
what is time and desc.. both are labels?
 
11:43 AM
i dint get u
 
Can you post the full code?
 
its the one ,i am working on bb this part of the code is java
 
ok it seems you have 2 labels. One for time and description
Create a vector of time and description labels
 
ya rite
so if time is say 8:00 and the desc occurs at 8:00 then i display desc against 8:00
now the case is like at 8:00 have more than one desc
 
"now the case is like at 8:00 have more than one desc" ?
 
11:47 AM
that is what i need desc.settext overrides the old data
 
yeah it will
 
since in the loop time matches one more data
 
So the problem is you want to remember the old data?
 
Is there an append function you can use?
 
11:48 AM
in each if loop
 
if is not a loop
 
string buffer?
sorry if ()
 
time.setText(stringyouwanttoadd + "\n" + time.getText())
Something like that
 
no i cannot
 
Why not?
 
11:50 AM
because desc.settext is a api for bb
 
what is bb?
blackberry?
if it is Java it is also an api for java
unless desc is actually comes from the bb library.. then maybe not. But if there is a settext, there has to be a gettext
 
ya
but it has java code
api are different
 
So you are telling me that you can't gettext? Send me the link to that api lol
Is that it?
 
gettext will not work
 
ok I still don't get why.. but
If you use setText it is going to overwrite the data unless you try the way I suggested.
I am not sure if there is append method or something
I gotta go. good luck with it
ok i will be here for a few mins yet
 
12:00 PM
append method isnt there
nyways thanks Lew
i think i have to use vector
 
It doesn't look in your loop as if you are creating 24 vectors
But whatever
Look at your code.. you create one vector before the loop.. the rest is just to add data to that vector.. which is perfectly fine.
 
ya but i need different data in if(0
if()
so i have to create new vector for each if
else the first if data will be appended witrh second n so on
 
right.. what is the max amount of data a time can have?
2 yeah?
Even if you were to have 24 vectors for each time..
You will have to loop through the elements for each vector.. big pain in the butt. In that case bad idea..
 
very true
 
Can't you just create a new label?
and add that label to the panel?
That is the easiest soln
If it is in anyway similar to swing
It should work.
 
12:09 PM
ya that will work
but i am lookin for some solution where i shld nt write much code
 
That will reduce the code... and you already have much code as it is. Which can be reduced if you use an array of time and desc
Those if statements can be reduced to one.. but your call.
 
ya rite looking for the same
 
Well as I said - not sure of the exact syntax but:
Label [] time = new label[24];
Label [] desc = new label[24];
set text to label - might be a bit difficult. Not sure how you name them.
And that's pretty much a loop and one if.
 
12:33 PM
hello
 
plz i wanna to load folder and display all the (jpeg) in jlist ist posible??
 
Yeah
 
also i wanna to do it with jlable that i have in my interface
but i didnt know how to show it
so the most easy solution to show the folder
 
You want to use a jlabel for?
 
12:36 PM
?
ok
 
You want to show all jpeg files in the directory with jlabel and jlist?
 
no no
with jlabel or jlit
jlist
just one
 
ok we will try jlist first
have you tried reading the dir first?
 
no not yet
 
12:40 PM
ok that
thankx
 
 
1 hour later…
2:06 PM
hello
 
now i get the name of my picture in jlist
so how can i to draw it?
 
look at the api for paint method
 
ok
 
and graphics draw
it takes an image i think.. so you will probably need bufferedimage or something
 
2:13 PM
plz
this is my code to list my folder ok
public void list(){

java.io.File dir

dir= new java.io.File("C:\\MiGalery\\pictures ");

File[] dirAlbums = dir.listFiles();
String[] listaArxiv=dir.list();

for(int i=0; i<listaArxivs.length; i++){

System.out.println(dirAlbums[i]);

String namealbum = dirAlbums[i].getName();
String path = dirAlbums[i].getPath();

DefaultListModel lista = new DefaultListModel();

for(int x = 0; x<listaArxiv.length; x++){
lista.addElement(dirAlbums[x].getName());


jList1.setModel(lista);
}
}
}
so i have to creat a new class to draw?
and call it in this class?
 
Have you heard of swing?
You need to create/inherit a jframe class and use the methods in it to draw your images
 
yes
 
From the jframe constructor maybe.. call your PictureLoader class to get a list of paths or whatever and call the paint method
 
but i think if i work with swing it not will be show me the picture in my jlist, it will creat a new jlist... or not
 
Do you still need to use the jlist
Oh you want to display the picture in the jlist?
 
2:18 PM
yes
 
You probably want to inherit jlist class then
I'm not sure if it is possible
But if you can.. you are halfway there
 
ok thank
 
np
Yeah it looks like you can.. good luck
 
i will do a search in google hop to find some think ;)
thk for ur help
 
Sure :P
 
2:53 PM
Can I ask question about jsp here?
 
3:04 PM
@LewsTherin there?
i have a query again
for (int i = 0; i < eventVector.size(); i++) {
currentData = (String) eventVector.elementAt(i);
System.out.println("currentdata " + currentData);

}
String currentTime = time23.getText();
if (currentData != null && currentData != "") {
UiApplication.getUiApplication().pushScreen(
new EventScreen(data, currentData, currentTime));
}
 
3:43 PM
anyone here knows something about ec2 aws ?
 
4:03 PM
Hello guys
Do any one knows JSF?
 
 
5 hours later…
9:08 PM
@user1195292 Hi dude
 
@LewsTherin hello :) plz
 
@cleo ohai
@cleo what's up?
 
wait plz hhh
i'm so much confused ,look i create a new class panel that content just the interface of panel like a small windows
i wanna to put every picture in this panel and then add to jlist
do u think is good idea?
ok
soory for my baaaad english
 
Why do you need a JList? Just a JPanel should be fine?
 
realy i dont know how to do it
 
9:18 PM
Ok let's get it working with a JPanel for now?
 
ok
i dont have no idea
 
I assume you have class that inherits JPanel?
 
no
if you want i can send u my code
for to see what im doing exctmy
 
ok create a class DrawPanel extends JPanel
 
ok
 
9:24 PM
Ok if you have it done let your new class have an image object
Link to how to store an image reference
 
sorry i lost the connection
 
 
2 hours later…
user868935
11:32 PM
How do you change the background color of a JTextPane? I've tried setBackground(), but it doesn't work...
 

« first day (534 days earlier)      last day (4397 days later) »