Java Code Examples for com.alee.laf.WebLookAndFeel#install()

The following examples show how to use com.alee.laf.WebLookAndFeel#install() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Cafebabe.java    From Cafebabe with GNU General Public License v3.0 7 votes vote down vote up
public static void main(String[] args) throws Exception {
	try {
		folder = new File(System.getProperty("user.home"), ".cafebabe");
		if (!folder.exists()) {
			folder.mkdir();
		}
		for (LookAndFeelInfo lafi : UIManager.getInstalledLookAndFeels()) {
			if (lafi.getName().equals("Nimbus")) {
				UIManager.setLookAndFeel(lafi.getClassName());
				break;
			}
		}
		new Translations(); //load translations
		WebLookAndFeel.install();
		System.setProperty("file.encoding", "UTF-8");
		Field charset = Charset.class.getDeclaredField("defaultCharset");
		charset.setAccessible(true);
		charset.set(null, null);
		Settings.loadSettings();
		WebLookAndFeel.setDecorateFrames(decorated);
		WebLookAndFeel.setDecorateDialogs(decorated);
	} catch (Throwable t) {
		t.printStackTrace();
	}
	new Cafebabe();
	gui.setVisible(true);
}
 
Example 2
Source File: MainWindow.java    From mars-sim with GNU General Public License v3.0 7 votes vote down vote up
public void initializeWeblaf() {

		try {
			// use the weblaf skin
//			UIManager.setLookAndFeel(new WebLookAndFeel());
//				WebLookAndFeel.setForceSingleEventsThread ( true );
			WebLookAndFeel.install();
			UIManagers.initialize();
			
			// Installing our extension for default skin
//	        StyleManager.addExtensions ( new XmlSkinExtension ( MainWindow.class, "SimpleExtension.xml" ) );

            // They contain all custom styles demo application uses
//            StyleManager.addExtensions ( new AdaptiveExtension (), new LightSkinExtension (), new DarkSkinExtension () );

		} catch (Exception e) {
			logger.log(Level.WARNING, Msg.getString("MainWindow.log.lookAndFeelError"), e); //$NON-NLS-1$
		}

	}
 
Example 3
Source File: LookUtils.java    From JByteMod-Beta with GNU General Public License v2.0 6 votes vote down vote up
public static void setLAF() {
  try {
    JByteMod.LOGGER.log("Setting default Look and Feel");
    if (JByteMod.ops.get("use_weblaf").getBoolean()) {
      WebLookAndFeel.install();
    } else {
      if (!changeLAF("javax.swing.plaf.nimbus.NimbusLookAndFeel")) {
        JByteMod.LOGGER.err("Failed to set Nimbus Look and Feel, trying to use WebLaF");
        WebLookAndFeel.install();
      }
    }
  } catch (Throwable t) {
    t.printStackTrace();
    JByteMod.LOGGER.err("Failed to set Look and Feel");
  }
}
 
Example 4
Source File: TexturedText.java    From mars-sim with GNU General Public License v3.0 6 votes vote down vote up
public static void main(String[] args) {
	    JFrame f = new JFrame();
	    WebLookAndFeel.install();
	    JPanel panel = new JPanel(new GridLayout(1, 17));
	    f.getContentPane().add(panel);
//	for (int i=0; i<17; i++) {
//		WebStyledLabel icon = new WebStyledLabel (WebLookAndFeel.getIcon(i));
//		panel.add(icon);
//	}
   

//    f.getContentPane().add(new TexturedText());
	
    f.setSize(800, 200);
    f.show();

  }
 
Example 5
Source File: ApplicationRunner.java    From lnk2pwn with MIT License 5 votes vote down vote up
@Override
public void run(String... args) throws Exception {
    LOGGER.info("Installing Web Look And Feel");
    WebLookAndFeel.install();
    
    SwingUtilities.invokeLater(new Runnable() {			
        @Override
        public void run() {
            LOGGER.info("Running the main frame");
            windowController.show(frame, BoundsPolicy.MAXIMIZE);
        }
    });	
}
 
Example 6
Source File: MainScene.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
public void finalizeMainScene() {

		// SwingUtilities.invokeLater(() -> {
		WebLookAndFeel.install();
		UIManagers.initialize();
		// });

		Platform.runLater(() -> {

			prepareScene();
			initializeTheme();
			prepareOthers();
			
			createSavingIndicator();
			openInitialWindows();
//			hideWaitStage(MainScene.LOADING);

//			// Caches the settlement unit windows
//			desktop.cacheSettlementUnitWindow();
			
			// Call setMonitor() for screen detection
			setMonitor(stage);
			stage.centerOnScreen();
			stage.setTitle(Simulation.title);
			stage.setResizable(false);
//			stage.show();
//			stage.requestFocus();
		});
		
		// Add MainScene to MasterClock's clock listener
		if (masterClock == null)
			masterClock = sim.getMasterClock();			
		masterClock.addClockListener(this);

	}
 
Example 7
Source File: LanguageEditor.java    From weblaf with GNU General Public License v3.0 5 votes vote down vote up
public static void main ( final String[] args )
{
    WebLookAndFeel.install ();

    final LanguageEditor languageEditor = new LanguageEditor ();
    languageEditor.loadDictionary ( LanguageManager.getDictionaries () );
    languageEditor.getDictionariesTree ().expandTillRecords ();
    languageEditor.getDictionariesTree ().setRootVisible ( false );

    final WebScrollPane scroll = new WebScrollPane ( StyleId.scrollpaneUndecorated, languageEditor );
    scroll.setPreferredSize ( 400, 600 );
    TestFrame.show ( scroll );
}
 
Example 8
Source File: DynamicMenu.java    From mars-sim with GNU General Public License v3.0 4 votes vote down vote up
public static void main ( final String[] args )
{
    WebLookAndFeel.install ();
    new DynamicMenu ();
}
 
Example 9
Source File: View.java    From desktopclient-java with GNU General Public License v3.0 4 votes vote down vote up
private View(ViewControl control, Model model) {
    mControl = control;
    mModel = model;

    WebLookAndFeel.install();
    ToolTipManager.sharedInstance().setInitialDelay(200);

    // chat view
    mChatView = new ChatView(this);
    // content area
    mContent = new Content(this, mChatView);

    mContactListView = new ContactListView(this, mModel);
    mChatListView = new ChatListView(this, mModel.chats());

    // search panel
    SearchPanel searchPanel = new SearchPanel(
            new ListView[]{mContactListView, mChatListView},
            mChatView);
    // status bar
    WebStatusBar statusBar = new WebStatusBar();
    mStatusBarLabel = new WebStatusLabel(" ");
    statusBar.add(mStatusBarLabel);
    // main frame
    mMainFrame = new MainFrame(this, mModel, mContactListView, mChatListView,
            mContent, searchPanel, statusBar);
    mMainFrame.addWindowFocusListener(new WindowAdapter() {
        @Override
        public void windowGainedFocus(WindowEvent e) {
            mChatView.getCurrentChat().ifPresent(Chat::setRead);
        }
    });

    // tray
    mTrayManager = new TrayManager(this, mModel, mMainFrame);
    // notifier
    mNotifier = new Notifier(this, mMainFrame);

    // register observer
    mModel.contacts().addObserver(mContactListView);
    mModel.chats().addObserver(mChatListView);
    mModel.chats().addObserver(mChatView);
    mModel.chats().addObserver(mTrayManager);

    this.setHotkeys();

    this.statusChanged(Control.Status.DISCONNECTED, EnumSet.noneOf(FeatureDiscovery.Feature.class));

    mMainFrame.setVisible(true);
}