• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Help Please

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Im creating my UI and I want to create a calendar that shows all the days of the month.
Basically I need help creating a calendar the only thing that I dont know how to do is creating a white box and inside that box it contains one of the days.
Thank You for your help.
 
Ranch Hand
Posts: 388
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
- you can create you own JPanel, overriding the paint() method to do your own stuff....(like drawing rectangels, circles, filling boxes writting text)
- use a JLabel with the text (or icons or whatever)
- use a JButton if you need to click it.
- im sure somebody did this before...if it was not an assignment, then search the web for a ready made component that does the trick
find more on java swing:
swing tutorial
if you give us more infos on what you wanna do, maybe we can gove more detailed answers.
k
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also check out GridLayout and GridBagLayout. As the names suggest, these let you create a grid of components. Each day could be a seperate descendant of JPanel as suggested above.
HTH
Layne
 
Angelo Watson
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you implement an event handler on a JLabel
 
If you send is by car it's a shipment, but if by ship it's cargo. This tiny ad told me:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic