Click here to Skip to main content
15,895,084 members
Home / Discussions / Java
   

Java

 
AnswerRe: hi Pin
toxcct28-Sep-08 21:43
toxcct28-Sep-08 21:43 
QuestionKoch Snowflake Pin
vultron_322926-Sep-08 13:10
vultron_322926-Sep-08 13:10 
AnswerRe: Koch Snowflake Pin
douss8-Oct-08 4:40
douss8-Oct-08 4:40 
Questionjava-linkedlist Pin
Bavirti25-Sep-08 1:00
Bavirti25-Sep-08 1:00 
AnswerRe: java-linkedlist Pin
toxcct25-Sep-08 2:19
toxcct25-Sep-08 2:19 
GeneralRe: java-linkedlist [modified] Pin
Bavirti25-Sep-08 2:46
Bavirti25-Sep-08 2:46 
GeneralRe: java-linkedlist Pin
toxcct25-Sep-08 2:49
toxcct25-Sep-08 2:49 
QuestionEquivalent to .net usercontrol Pin
Russell Jones22-Sep-08 22:33
Russell Jones22-Sep-08 22:33 
Hi guys,

I'm trying to build a Swing application. It's all gone well enough so far but now I want to refactor my main form as I've got hundreds of controls on it and hundreds of corresponding methods.

In a few cases I've got UI elements that should be grouped together into a single class and resused. An example of this is a countdown timer. Basically three aligned labels containing 2 digits per label with colons in between ie 00:10:15.

I've tried to extend from JPanel and this allows me to add the component to the palette in NetBeans but I can't get the labels to be visible on screen. I changed the background colour of my control in its constructor and I can see that so I'm sure the component is being instantiated properly.

Unfortunately my router broke at home last night so I haven't got my source to hand but the important Method goes something like this.

private void DrawLabels()
{
labels[0] = new JLabel("00");
labels[1] = new JLabel("00");
labels[2] = new JLabel("00");
this.add(label[0]);
this.add(label[1]);
this.add(label[2]);
}

I've tried overriding paint(Graphics) and doing a drawstring in there but i don't see anything from that either. I've also tried deriving from JComponent with no success.

I can't find any info about creating your own controls and suspect they might be called something different or i'm going about build one the wrong way.

Can anyone give me any pointers?

Cheers

Russell
AnswerRe: Equivalent to .net usercontrol Pin
Russell Jones22-Sep-08 23:10
Russell Jones22-Sep-08 23:10 
QuestionOdd String/Vector behavior [solved] Pin
David Crow19-Sep-08 5:55
David Crow19-Sep-08 5:55 
AnswerRe: Odd String/Vector behavior Pin
toxcct19-Sep-08 7:07
toxcct19-Sep-08 7:07 
GeneralRe: Odd String/Vector behavior Pin
David Crow19-Sep-08 7:15
David Crow19-Sep-08 7:15 
Questionhow to send live recording audio Pin
manju23reddy17-Sep-08 21:17
manju23reddy17-Sep-08 21:17 
Questionsimple web cam chat application Pin
Matthew Dally17-Sep-08 17:12
Matthew Dally17-Sep-08 17:12 
QuestionDownloading Bank Account Info... Pin
bane7313-Sep-08 7:36
bane7313-Sep-08 7:36 
QuestionSwing:JDialog Pin
shwetabhas12-Sep-08 10:21
shwetabhas12-Sep-08 10:21 
AnswerRe: Swing:JDialog Pin
toxcct14-Sep-08 22:10
toxcct14-Sep-08 22:10 
QuestionSSN Validation Pin
Sudheer.kumarmatta9-Sep-08 20:16
Sudheer.kumarmatta9-Sep-08 20:16 
Questionproblem in bluetooth programming in java Pin
manju23reddy8-Sep-08 20:09
manju23reddy8-Sep-08 20:09 
QuestionAbstract Data Types Pin
Kevin Marois8-Sep-08 16:51
professionalKevin Marois8-Sep-08 16:51 
AnswerRe: Abstract Data Types Pin
toxcct8-Sep-08 21:05
toxcct8-Sep-08 21:05 
GeneralRe: Abstract Data Types Pin
Kevin Marois10-Sep-08 8:37
professionalKevin Marois10-Sep-08 8:37 
GeneralRe: Abstract Data Types Pin
toxcct10-Sep-08 9:16
toxcct10-Sep-08 9:16 
AnswerRe: Abstract Data Types Pin
Reagan Conservative18-Sep-08 11:42
Reagan Conservative18-Sep-08 11:42 
QuestionSession problem Pin
Mogaambo1-Sep-08 20:01
Mogaambo1-Sep-08 20:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.