Source:
public class IntegerMinValueTest {
 public static void main(String[] args) {
  int minValue = Integer.MIN_VALUE;
  int negatedMinValue = -minValue;
 
  System.out.println("minValue: " + minValue);
  System.out.println("negatedMinValue: " + negatedMinValue);
 }
}

Output:
minValue: -2147483648
negatedMinValue: -2147483648

Integer 최소값을 음수화해도 음수임을 확인할 수 있다.
Posted by 알 수 없는 사용자
,

Posted by 알 수 없는 사용자
,

UI 전체 바꾸기
FontUtil.setUIFont (new FontUIResource(
  DEFAULT_TITLE_FONT_NAME,
  DEFAULT_TITLE_FONT_STYLE,
  DEFAULT_TITLE_FONT_SIZE));

import java.util.*;

import javax.swing.*;
import javax.swing.plaf.*;

public class FontUtil {
 public static void setUIFont(FontUIResource f) {
  Enumeration<Object> keys = UIManager.getDefaults().keys();
  while (keys.hasMoreElements()) {
   Object key = keys.nextElement();
   Object value = UIManager.get(key);
   if (value instanceof FontUIResource) {
    UIManager.put(key, f);
   }
  }
 }
}



특정 컴포넌트 바꾸기
UIManager.put("TextPane.font", DEFAULT_TEXT_FONT);

Posted by 알 수 없는 사용자
,