“...I've been working since 2008 with Ruby / Ruby on Rails, love a bit of Elixir / Phoenix and learning Rust. I also poke through other people's code and make PRs for OpenSource Ruby projects that sometimes make it. Currently working for InPay who are based in Denmark...”

Rob Lacey
Senior Software Engineer, Copenhagen, Denmark

MATOTU

Old blog posts I never published, except I have now #7

I wonder if this even still works…maybe.

module Braindeaf
  module Matotu
    require "java"

    # Swing
    java_import javax.swing.JFrame
    java_import javax.swing.JPanel
    java_import javax.swing.JTextField
    # AWT
    java_import java.awt.GridBagLayout
    java_import java.awt.GraphicsEnvironment

    class ShippingGUI < JFrame

      def initialize
        super('ShippingGUI')
        self.init
      end

      def init
        puts header
        @frame = JFrame.new
        @backpanel  = JPanel.new(GridBagLayout.new)
        @input = JTextField.new
        @backpanel.add(@input)
        @frame.add(@backpanel)

        @frame.setLocationRelativeTo nil
        @frame.undecorated = true
        @frame.default_close_operation = JFrame::EXIT_ON_CLOSE
        GraphicsEnvironment.local_graphics_environment.default_screen_device.full_screen_window = @frame
        @frame.setVisible true
      end

      def header
        header = <<-STR
  _____ ______       ________  _________    ________  _________    ___  ___
  |\   _ \  _   \    |\   __  \|\___   ___\ |\   __  \|\___   ___\ |\  \|\  \
  \ \  \\\__\ \  \   \ \  \|\  \|___ \  \_| \ \  \|\  \|___ \  \_| \ \  \\\  \
   \ \  \\|__| \  \   \ \   __  \   \ \  \   \ \  \\\  \   \ \  \   \ \  \\\  \
    \ \  \    \ \  \ __\ \  \ \  \ __\ \  \ __\ \  \\\  \ __\ \  \ __\ \  \\\  \ ___
     \ \__\    \ \__\\__\ \__\ \__\\__\ \__\\__\ \_______\\__\ \__\\__\ \_______\\__\
      \|__|     \|__\|__|\|__|\|__\|__|\|__\|__|\|_______\|__|\|__\|__|\|_______\|__|
        STR
      end
    end
  end
end
Braindeaf::Matotu::ShippingGUI.new