Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

create titled border in awt dialog  RSS feed

 
Anton Mo
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to do a border/frame like this with awt only? (see attached screenshot)

Currently I have a very simple layout with gridlayout (one column only) at the dialog level,

then add a panel with flow layout on each row.

So, One row is Nickname row, one row is password row. I would like to mimic what is shown.

How do i go about adding the "Your login information" border around those two rows ?

I will have to extend an awt panel, and then do something in paint? or possibly involve insets?
login.gif
[Thumbnail for login.gif]
login
 
Anton Mo
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wow, I found the answer, guess where, from 12 years ago!

http://www.coderanch.com/t/336341/GUI/java/Panel-border
 
Campbell Ritchie
Sheriff
Posts: 55333
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course you can add a border to any component, but why are you using Dialog? Use the Swing component JDialog. Nobody has used AWT components for about 15 years.

Moving discussion to our GUIs forum.
 
Anton Mo
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it's a very old application, made entirely in awt. I'm just adding a bit of code and felt it would violate some unwritten rule about consistency.

also never really done gui programming, so I figured better learn the old fashioned style first. Then when someone says borderfactory, I know what code I get for free
 
Campbell Ritchie
Sheriff
Posts: 55333
157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anton Mo wrote:. . .  so I figured better learn the old fashioned style first. . . .
That is a bit like learning to drive and starting off by learning how to use the starting handle. Don't learn AWT. You should probably go straight for JavaFX.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!