Dutch period

As the Dutch set up camp in what was to become Jakarta, Banten remained a powerful ruling house and a harbour for foreign competitors. An impressive trading network was set up under Banten's greatest rulers, Sultan Agung, but unfortunately civil war within the house led to Dutch intervention and its eventual collapse.
The Mataram kingdom was another mater. As the power of the Dutch grew, the empire began to disintegrate, and by the 18th century infighting was taking its toll. The first two Javanese War of Succession were fought but fortunately resolved by the treaty of 1743; the ruler Pakubuwono II was restored to his battered court, but the price of concessions to the colonial power was high.
Obviously needing a fresh start, Pakubuwono II abandoned his old capital at Kartosuro and established a new court at Solo (Surakarta). However, rivalry within the court soon reared its ugly head again, resulting in the Third Javanese War of Succession in 1746. The Dutch rapidly lost patience and split the kingdom in three, creating the royal houses of Solo and Yogyakarta, and the smaller domainof Mangkunegaran within Solo.
Yogyakarta's founder, Hamengkubuwono I was a most able ruler but within 40 years of his death his successor had all but soured relations with the Dutch and his rivals in Solo. In 1812 Erupeans troops supported by the sultan's ambitious brother and Mangkunegaran, plundered the court of Yogyakarta and the sultan was exiled to Penang, to be repleace by his son.
Into this turbulent picture stepped one of the most famous figures of Indonesia history, Prince Pangeran Diponegoro, who subsequently launched the anti Dutch Java war og 1825 - 1830. At the end of this guerrilla war, the Dutch held sway over all the royal courts, which soon became ritual establishments with Dutch residen (head of a residency during colonial administration) exercising control. With no real room
 or will for political monoeuvre, the courts turned their energies to traditional court ceremonies and artistic patronage, thus creating the rich cultural cities we see today.