Jump to content

For GUI designers question...

- - - - -

  • Please log in to reply
7 replies to this topic

#1
toto_7

toto_7

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 295 posts
Hello,

I have a JFrame filled with JButtons, my question is if is possible to add on the left up corner the count timer that i have until now in other window.

Thank you
*Attached a simple plan below

Attached File  gui.jpg   37.46K   34 downloads

"Programming is like sex. One mistake and you have to support it for the rest of your life."

-Michael Sinz

#2
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
Create new JPanel with BorderLayout.
In this JPanel add another JPanel with a flowlayout : align left.
In ths jpanel with flowlayout, add the timer.
Add the flowlayout panel to the north of the borderlayout panel.
Add the borderlayout panel to the center of your frame.

#3
toto_7

toto_7

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 295 posts
BorderLAyout Panel, will contains JButtons?

"Programming is like sex. One mistake and you have to support it for the rest of your life."

-Michael Sinz

#4
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
Attached File  panels.PNG   17.39K   26 downloads
I didn't test it (as paint didn't have a java compiler :P). But it should be along those lines.

#5
toto_7

toto_7

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 295 posts
Thank you, is working but there is any way to attach it on the PANEL 1 OR change the colour of the background? PANEL 1 has image that has lime green picture, so when timer appearing has the default grey colour on the top of the frame.

"Programming is like sex. One mistake and you have to support it for the rest of your life."

-Michael Sinz

#6
wim DC

wim DC

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 2,084 posts
  • Programming Language:Java, JavaScript, PL/SQL
  • Learning:Java
do setOpaque(true); on jpanel2

#7
toto_7

toto_7

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 295 posts
First part done, thank you wim DC.

Now i want to add a status window on East of the page. I have some problems. First, there is a gap between CENTER and EAST. My Frame has navy blue background, and the gap is white, i don't know why leaves a gap there. There is any solution? Secondly, status window has the same colour with the main part of the CENTER, not the edges. There is any solution for this too?

Attached again a plan using paint, excuse me, i'm not so good artist :P

[ATTACH]3993[/ATTACH]

*EDIT: SOLVED!

Attached Files

  • Attached File  pic1.jpg   106.93K   15 downloads

Edited by toto_7, 06 July 2011 - 04:23 AM.

"Programming is like sex. One mistake and you have to support it for the rest of your life."

-Michael Sinz

#8
mitya

mitya

    Newbie

  • Members
  • Pip
  • 4 posts
Dude, forget you troubles and just get happy, chase all your layout away, instead use GridBagLayout, come get hapy, get ready for the judgment day.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users