Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4117496

Multiline menubars do not display correctly (Solaris), print correctly (win32)

XMLWordPrintable

    • x86, sparc
    • solaris_2.6, solaris_7, windows_nt

      orig synopsis:
        "Solaris: Multiline menubars do not print correctly"

      Currently, AWT does not render multiline menubars correctly on the screen.
      However, when such functionality is added, the menubars will still not
      print correctly on the printer.

      import java.awt.*;
      import java.awt.event.*;
      import java.applet.Applet;


      public class ButtonTest extends Applet {
          public static void main(String[] args) {
              new ButtonTest().start();
          }
        
          public void start() {
              new ButtonTestFrame();
          }
      }

      class ButtonTestFrame extends Frame implements ActionListener {
          public ButtonTestFrame() {
              super("ButtonTest");
              MenuBar mb = new MenuBar();
              Menu file = new Menu("FileFileFile");
              Menu edit = new Menu("EditEditEditEditEdit");
              Menu view = new Menu("ViewViewViewView");
              file.setFont(new Font("Helvetica", Font.PLAIN, 15));
              edit.setFont(new Font("Times", Font.ITALIC, 15));
              view.setFont(new Font("Courier", Font.BOLD, 15));
              file.setEnabled(false);
              mb.add(file);
              mb.add(edit);
              mb.add(view);
              Button button = new Button("Print");
              button.setActionCommand("print");
              button.addActionListener(this);
              add(button);
              setMenuBar(mb);
              setLayout(new GridLayout());
              setSize(200, 200);
              setVisible(true);
          }

          public void actionPerformed(ActionEvent evt) {
              String cmd = evt.getActionCommand();

              if (cmd.equals("print")) {
                  PrintJob pjob = getToolkit().getPrintJob(this,
                                                           "ButtonTest",
                                                           null);
                  if (pjob != null) {
                      Graphics pg = pjob.getGraphics();

                      if (pg != null) {
                          printAll(pg);
                          pg.dispose();
                      }

                      pjob.end();
                  }
              }
          }
      }

            vbaranovsunw Vyacheslav Baranov (Inactive)
            dmendenhsunw David Mendenhall (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported:
              Indexed: