-4

How to include a standard panel of buttons (like on top of every page 'Print', 'New' etc) on every Java Swing page using Java?

Roman C
  • 49,761
  • 33
  • 66
  • 176
  • 3
    *"Quick answer required."* Patience required. Voting to close as 'too localized - ..a specific moment in time'. – Andrew Thompson Sep 02 '12 at 12:31
  • 2
    What have you done till now? SO is not machine which print's code by your wish. – Branislav Lazic Sep 02 '12 at 12:32
  • Actually I am want to include same panel on every page without making a new Panel. Just to include panel on every page. – user1511414 Sep 02 '12 at 12:36
  • Brano88 ...I am new in Java swings and just playing with swing components. – user1511414 Sep 02 '12 at 12:42
  • BTW - What Java class DYM by 'page'? A `JPanel`, `JDialog`, `JFrame`..? – Andrew Thompson Sep 02 '12 at 12:59
  • 2
    "Quick answer required" is a bit too demanding for someone asking for help from volunteers. Next time I suggest you consider a softer less demanding tone. Either that or pay for your help and demand all you'd like. – Hovercraft Full Of Eels Sep 02 '12 at 13:07
  • 1
    I am sorry by writing unintentially the word 'Quick answer'. sorry for that. – user1511414 Sep 02 '12 at 13:24
  • I have deleted it. I recommend that if you're still stuck, ask a new question, but in this question, describe in greater detail just what you're trying to do, show us what you've tried and tell us how it isn't working. The more useful information you can give us in your question, the better we'll be able to help you. Luck! – Hovercraft Full Of Eels Sep 02 '12 at 13:36

2 Answers2

1
  1. Create a class that will extend JPanel, place your buttons in it and declare their standart behavior.
  2. Extend this class in every "look-alike class you want" you create.
Eli Turchinsky
  • 331
  • 2
  • 8
1

Use JToolBar and add buttons to it.

JToolBar jToolBar = new JToolBar();
JButton jButtonFileOpen = new JButton();
jToolBar.add(jButtonFileOpen);
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
Roman C
  • 49,761
  • 33
  • 66
  • 176