Exemple #1
0
 private JScrollPane buildTextPaneDebug() {
   textPaneDebug = createTextPane(sansFont, Color.white);
   textPaneDebug.setAutoscrolls(true);
   textPaneDebug.setBorder(new EmptyBorder(3, 3, 3, 3));
   final FontMetrics fontMetricsSans = textPane3270.getFontMetrics(monospacedFont);
   final JScrollPane textPaneDebugScroller = new JScrollPane(textPaneDebug);
   textPaneDebugScroller.setPreferredSize(
       new Dimension(textPane3270.getWidth(), 3 + 10 * fontMetricsSans.getHeight()));
   textPaneDebugScroller.setAlignmentX(JDialog.LEFT_ALIGNMENT);
   textPaneDebugScroller.setBorder(new LineBorder(Color.gray));
   textPaneDebugScroller.setAutoscrolls(true);
   return textPaneDebugScroller;
 }
Exemple #2
0
 private boolean updateTextPane3270Size() {
   final FontMetrics fontMetricsMonospaced = textPane3270.getFontMetrics(monospacedFont);
   int w = s3270.getScreen().getWidth();
   int h = s3270.getScreen().getHeight();
   if (w != currentWidth || h != currentHeight) {
     textPane3270.setPreferredSize(
         new Dimension(
             (w + 2) * fontMetricsMonospaced.charWidth(' '),
             (h + 2) * fontMetricsMonospaced.getHeight()));
     currentWidth = w;
     currentHeight = h;
     return true;
   }
   return false;
 }